XMLparse empty tag
Moderators: Dorian (MJT support), JRL
XMLparse empty tag
Unfortunately I hoped that in the new version 14.4.01 an annoying problem with XMLparse would have been solved. However, I still see a system error occurring as soon as XMLparse is used for an empty tag. Now I have to make a relatively complex check before I can use XMLparse. I would guess that it is just a minor modification in XMLparse to return a empty field when the tag is empty in the XML file. Could you please modify XMLparse behaviour in the next version.
- Marcus Tettmar
- Site Admin
- Posts: 7393
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: XMLparse empty tag
Sorry we missed that. I've made sure it is on bug tracker and will give this priority to investigate and fix.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Pro Scripter
- Posts: 70
- Joined: Sun May 03, 2009 11:49 pm
- Location: AU
Re: XMLparse empty tag
This is how i like to use xmlparse:
Note: title for <book category="CHILDREN"> is empty and will return null with no error warning.
Note: title for <book category="CHILDREN"> is empty and will return null with no error warning.
Code: Select all
Let>IGNOREERRORS=1
LabelToVar>XML,sXML
XMLParse>sXML,/bookstore/book,val,numBooks
Let>k=0
Repeat>k
Let>k=k+1
XMLParse>sXML,/bookstore/book[%k%]/title/text(),val,len
MessageModal>val
Let>val=
Until>k=numBooks
Let>IGNOREERRORS=0
/*
XML:
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
<book category="COOKING">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="CHILDREN">
<title lang="en"></title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="WEB">
<title lang="en">XQuery Kick Start</title>
<author>James McGovern</author>
<author>Per Bothner</author>
<author>Kurt Cagle</author>
<author>James Linn</author>
<author>Vaidyanathan Nagarajan</author>
<year>2003</year>
<price>49.99</price>
</book>
<book category="WEB">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
*/
Loving MS's Capabilities!!!