A question about LN Softwares XML Tools
A question about LN Softwares XML Tools
- Subject: A question about LN Softwares XML Tools
- From: Steve Thompson <email@hidden>
- Date: Thu, 08 Aug 2002 12:41:31 +0100
I have a large database for which I have written an agent that produces XML
when a query is run. I did this because every SQL product for the Mac that I
tried was prone to crashing.
So I now have a script that does this:
download "
http://192.168.0.64/XMLPasst.nsf/XMLDetails?OpenAgent&DeaID~" &
DNum & "~~DeaID" to file "Steve:test" replacing yes with progress
Basically, the user types in a dealer number (DNum) and this line downloads
an XML file to my hard disk. I then read the contents of that XML file and
parse it using XML tools.
The problem I have discovered is that for example, not every dealer has a
website or a fax number. The returned data will contain
<DealerWebSite></DealerWebSite>
And the parsed data will say
{
class:XML element,
XML tag:"dealerwebsite"
}
A dealer that does have a website:
<DealerWebSite>www.dealer.com</DealerWebSite>
will return
{
class:XML element,
XML tag:"dealerwebsite",
XML contents:{
"www.dealer.com"
}
}
What I have at the moment is a subroutine that goes through all the data and
checks that each tag has content. What I want to know is if there is a way
of saying "If there is a tag 'dealerwebsite' does this tag have an attribute
'XML Content'?". This would mean that I wouldn't have to check each piece of
data in turn...
If anyone from LNS is reading - why doesn't <dealerwebsite></dealerwebsite>
parse to XML tag:"dealerwebsite",XML Contents:{""} ? I'm sure there's an
answer but it would have made my life so much easier if an empty tag parsed
to an empty string instead of nothing at all!
Thanks in advance for any suggestions
Steve
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.