On 1/15/07, Derek Bump <[EMAIL PROTECTED]> wrote:
Well, I'm a little behind the game, but I'm trying to work with XML
documents, and I'm running into walls. I am having difficulty
understanding all the different variations of XML, or for that matter,
making Regular Expressions that allow me to forget trying to understand
XML and just pull the data I need.
For example, I can get tags with no problems by using the following command:
-- Example: <ShortName>Google</ShortName>
get matchText(tData,"<Shortname>(.*)</Shortname>", tShortName)
But I start running into problems with tags that have attributes:
<Url type="text/html" template="http://www.whatever.com/search">
</Url>
And tags that have attributes AND "slashes" at the end:
<Url type="text/html" template="http://www.whatever.com/search"/>
Hi Derek,
I tried saving your XML as a text file with the official XML header:
<?xml version="1.0"?>
<Url type="text/html" method="GET" template="http://www.google.com/search">
<Param name="q" value="{searchTerms}"/>
<Param name="ie" value="utf-8"/>
<Param name="oe" value="utf-8"/>
<!-- Dynamic parameters -->
<Param name="rls"
value="{moz:distributionID}:{moz:locale}:{moz:official}"/>
<MozParam name="client" condition="defaultEngine"
trueValue="firefox-a" falseValue="firefox"/>
</Url>
Then I opened it using the XML construction kit that is part of my XML
demo <http://www.troz.net/Rev/tutorials/XMLdemo1.rev.gz>.
It worked perfectly and I was able to extract all the elements & their
attributes perfectly. While the XML library has a learning curve, I
would recommend that you use it for such parsing. Or use Ken Ray's
third-party XML library.
Cheers,
Sarah
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution