Traversing/Parsing XML file in PB - Need Help

This is a multi-part message in MIME format.

---=_forums-1-dub4a8c38b9
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit

Hi,

Need help on how to get values in an XML file. My XML would
something like the one I attached.  Depending on the input
status attribute (success or fail), I would need to retrieve
the UnallocatedQuantity value.  I was able to go as far as
checking the attribute value, but couldn't quite figure out
how to get the value for the quantity.  The code I tried
just keeps on returning the 1st one it found.  Please help.

xmldom.ConnectToNewObject("Microsoft.XMLDOM")

//Load XML File
xmldom.LoadXml(s_inline)

xml_node_list = xmldom.SelectNodes("//Input")
li_length = integer(xml_node_list.length) - 1
FOR i = 0 to li_length
	xml_node = xml_node_list.item(i)
	ls_attribute =xml_node.getAttribute("status")
	IF TRIM(lower(ls_attribute)) = "success" THEN
            //GET UNALLOCATEDQUANTITY
		xml_doc =
xml_node.SelectSingleNode("//UnallocatedQuantity")
                s_text = xml_doc.NodeTypedValue
        ELSE
            //Set Quantity to 0
        END IF
NEXT

---=_forums-1-dub4a8c38b9
Content-Type: text/xml; name="Output.xml"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Output.xml"

PFBheWxvYWQ+DQogPElucHV0IHN0YXR1cz0ic3VjY2VzcyI+DQogIDxBbGxv
Y2F0ZWRRdWFudGl0eT4wLjAwMDAwPC9BbGxvY2F0ZWRRdWFudGl0eT4gDQog
IDxCYXNlSXRlbVVuaXQ+Qk9YPC9CYXNlSXRlbVVuaXQ+IA0KICA8T25IYW5k
UXVhbnRpdHk+MTAyLjAwMDAwPC9PbkhhbmRRdWFudGl0eT4gDQogIDxSZXNl
cnZlZFF1YW50aXR5PjAuMDAwMDA8L1Jlc2VydmVkUXVhbnRpdHk+IA0KICA8
VW5hbGxvY2F0ZWRRdWFudGl0eT4xMDIuMDAwMDA8L1VuYWxsb2NhdGVkUXVh
bnRpdHk+IA0KICA8VW5yZXNlcnZlZFF1YW50aXR5PjEwMi4wMDAwMDwvVW5y
ZXNlcnZlZFF1Y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1cz0ic3VjY2VzcyI+DQogIDxBbGxv
Y2F0ZWRRdWFudGl0eT4wLjAwMDAwPC9BbGxvY2F0ZWRRdWFudGl0eT4gDQog
IDxCYXNlSXRlbVVuaXQ+Qk9YPC9CYXNlSXRlbVVuaXQ+IA0KICA8T25IYW5k
UXVhbnRpdHk+NTIuMDAwMDA8L09uSGFuZFF1YW50aXR5PiANCiAgPFJlc2Vy
dmVkUXVhbnRpdHk+MC4wMDAwMDwvUmVzZXJ2ZWRRdWFudGl0eT4gDQogIDxV
bmFsbG9jYXRlZFF1YW50aXR5PjUyLjAwMDAwPC9VbmFsbG9jYXRlZFF1YW50
aXR5PiANCiAgPFVucmVzZXJ2ZWRRdWFudGl0eT41Mi4wMDAwMDwvVW5yZXNl
cnZlZFF1YW50aXR5PiANCiA8L0lucHV0Pg0KPC9QYXlsb2FkPg==

---=_forums-1-dub4a8c38b9--
0
Melissa
8/19/2009 5:39:05 PM
sybase.powerbuilder.xml 546 articles. 0 followers. Follow

0 Replies
692 Views

Similar Articles

[PageSpeed] 10

Reply:

Similar Artilces:

XML::Parser XML::SimpleObject -> First XML parsing pls help
I took the example from http://www.xml.com/pub/a/2001/04/18/perlxmlqstart1.html I wanted something really simple for XML parsing that basically just reads values. But I'm stuck (again). #Here's what I'm trying to run: #!c:\perl\perl.exe use XML::Parser; use XML::SimpleObject; use strict; my $file = 'c:\perl\work\job001_card.xml'; my $parser = XML::Parser->new(ErrorContext => 2, Style => "Tree"); my $xso = XML::SimpleObject->new( $parser->parsefile($file) ); foreach my $mail ($xso->child('job_card')->children(&...

XML Transform to 1 XML file to another XML File
Hello All  I am a novice programmer. I want to transform 1 xml file to another xml file. I am looking for a example code where user will select source xml file and create another xml file in different file with different fields with some default validation of parsing date and default values.  Can anyone help me or let me know any available source code in C#/ASP.Net?  Ms Disha I am assuming you know xslt, if not, you would have to go look at that.  But if you do, then this document will help you out http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=...

Help with xml data into xml file
I have some xml data that comes from a web service . I want to write that xml data into xml file.  Could any one please post some samples   thanks Cemal   Please disregard, I found the solution. Try below code   FileStream fs = new FileStream(Server.MapPath("~/myxml.xml"), FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite);            StreamWriter sw = new StreamWriter(fs);            sw.Write(ValueReturnFromWEbService); &nbs...

Open XML File, string.Replace a string, then Save XML file... help!
  Dim XMLFiles As String() = System.IO.Directory.GetFiles("C:\Users\App_Data\posts") For Each strFile As String In XMLFiles Try Dim xmlDoc As New System.Xml.XmlDocument xmlDoc.Load(strFile) Dim xmlNodeList As System.Xml.XmlNodeList = xmlDoc.SelectNodes( Dim es As String = xmlDoc.InnerText.Replace("<font face=""trebuchet ms,geneva"" size=""2"">", "") es = es.Replace("<font face=""...

Select XML Data type (xml) from sql server 2005 and then save to a XML file on local machine?? Help !
Hi All  I have a problem i am selecting a row of data from a database, within that row is a column in which i build up a xml in a stored procedure, it creates an xml and stores it in the column name xmldata which is of xml datatype. This works great My problem is how do i now create a xml file on my local machine with that data, below is what i have so far :- Dim conn1 As New SqlConnection()conn1.ConnectionString = (ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString) conn1.Open()Dim DBCmd As New SqlCommand Dim DataRecieved As SqlDataReaderDBCmd...

XML Creating and Parsing Very large XML Files
Hello Everyone For a long while I have used SAX for Pascal with a Delphi 6 project. it is reading and writing very large XML files (over 800MB and larger). The project has been running for years - and I recently had to upgrade to Delphi 2007 - and I discovered that SAX for Pascal has not been ported to D2007. The authors have provided full source - which I have - but now I need to get it installed into D2007. Has anyone moved the Packages over to D2007? If this is not the best way of reading and writing really large XML files anymore - any thoughts as to what is the best met...

Help with parsing XML File
I have the following section of XML: <SectionStyles>         <Section id="1" leftSide="" rightSide="">           list-style-type: none;           <Item leftSide=".." rightSide="..">list-style-type: decimal;</Item>         </Section>         <Section id="2" leftSide="--" rightSide="--">list-style-type: circle;</Section>         <SectionName id="1" section="test1"  leftSide="\\" rightSide="//">   &n...

Help parsing an XML file
Please help!! :)  I am trying to find a way to parse the following XML file. The problem I'm running into (I think) is that the fields have spaces in their name (i.e. Page ImportFileName).  I tried to do this with ASP about a year ago and didn't have any luck.  Now I'm trying to do it with VB.NET.  Any help is appreciated.  My current code is below the XML file.  Thanks!! Robert Lewis <BatchExport><Batch Name="100044 - dmw 349543783 1:17:51 PM eid:1508" CreationUserID="CPPSB019D" CreationDateTime="2004-04-13 15:46:56" CreationSiteName="IL_8ATAA">&l...

How to convert XML file into XML Schema PLEASE HELP!!!!
Hi, How can I convert an XML file to XML schema PLEASE HELP!!!! byeHighOnCodingWanna get high! What do you mean by convert to XML Schema, do you mean infer the XML Schema from an specific XML document? If you have VS.NET it can infer the schema from an XML document. Hi, i have a xml file and I want to write schema for that file. I hope u this helps and thanks for the Quick Reply. byeHighOnCodingWanna get high! You can use one tool in gotdotnet to do that: http://apps.gotdotnet.com/xmltools/xsdinference/Default.aspx There is also a tool for infering x...

superreview granted: [Bug 219355] XML Parsing Error: undefined entity on files with Mime-Type: application/xhtml+xml, including about:, or "text/xml" : [Attachment 131594] use NS_GRE_DIR
Darin Fisher <darin@meer.net> has granted Benjamin Smedberg <bsmedberg@covad.net>'s request for superreview: Bug 219355: XML Parsing Error: undefined entity on files with Mime-Type: application/xhtml+xml, including about:, or "text/xml" http://bugzilla.mozilla.org/show_bug.cgi?id=219355 Attachment 131594: use NS_GRE_DIR http://bugzilla.mozilla.org/attachment.cgi?id=131594&action=edit ...

superreview requested: [Bug 219355] XML Parsing Error: undefined entity on files with Mime-Type: application/xhtml+xml, including about:, or "text/xml" : [Attachment 131594] use NS_GRE_DIR
Benjamin Smedberg <bsmedberg@covad.net> has asked Darin Fisher <darin@meer.net> for superreview: Bug 219355: XML Parsing Error: undefined entity on files with Mime-Type: application/xhtml+xml, including about:, or "text/xml" http://bugzilla.mozilla.org/show_bug.cgi?id=219355 Attachment 131594: use NS_GRE_DIR http://bugzilla.mozilla.org/attachment.cgi?id=131594&action=edit ...

XML parsing error: no element found while reading XML files
 I have a program which will read an XML file and Insert those values to a DB as well.Now If my Inputed excel file is too large (more than 500 records) ,When reading ,I am getting the following error XML parsing error: no element foundlocation : http://mysitename/myfilename.aspxLine number 1,colulmn 1 :^ I already checked whether this element is not null before doing the transactions.This is my code            DataSet myDataSet = new DataSet();            SqlCommand ob...

How can i add a xml file to an other xml file?
such as i have a xml file : <item1> <item2> <item3>aaa</item3> <item4>bbb</item4> </item2> <item1> an other one is: <item2> <item3>ccc</item3> <item4>ddd</item4> <item2> i wanted is: <item1> <item2> <item3>aaa</item3> <item4>bbb</item4> </item2> <item2> <item3>ccc</item3> <item4>ddd</item4> <item2> <item1> thanks. You ca...

Error parsing XML control using external XML file.
I am trying to use a simple asp:XML control and the documentSource attribute is an external XML file. I get this error: URL is not a valid virtual path What is the solution for this?   Hi brucec, Please try loading remote xml into XmlDocument and bind it to server control: // Create the XmlReader object. XmlTextReader reader = new XmlTextReader("http://msdn.microsoft.com/rss.xml"); XmlDocument doc = new XmlDocument(); doc.Load(reader); reader.Close();  Please feel free to let us know if you have further problem.Thanks.NOTE:If yo...

Load XMl file and read xml file
How do I load and read nodes from the xml file in c#.??? ThankYou Sample code: http://www.kirupa.com/net/reading_xml_directly_pg1.htmJack Yang.NET Developer Here is how you read xml file and loop and display nodesXmlDocument xDoc = new XmlDocument();xDoc.Load(xmlPath); foreach(XmlNode node in xDoc.SelectNodes("//nodeName you want to display")){Response.Write("name: " + node.Attributes["name"].InnerText + " value: " + node.Attributes["value"].InnerText);}...

Web resources about - Traversing/Parsing XML file in PB - Need Help - sybase.powerbuilder.xml

Mitigate Agile Transformation Risk Through Traversing The Transformation Canvas
The assumptions contained within a Transformation Canvas can be validated by traversing different sections of the canvas. The order of this traversal ...

Traversing the Lincoln Tunnel Via F1 Car
Since childhood I've only been on the Hudson River a couple of times, riding the Circle Line and such; but over the course of my life I've spent ...

It's truly fun traversing Assassin's Creed Syndicate's London
Ubisoft finally had all the perils that come with annual franchise installments come crashing down on it last year with Assassin's Creed Unity ...

Traversing Personal Brand Management While Avoiding Company Brand Landmines
Having a personal brand helps to set you apart in a digital world where it’s really easy to get lost. Your brand becomes an asset, something ...

Gamasutra - Interview: Noisycroak On Traversing Castlevania's Musical Timeline
In this audio interview, Gamasutra talks to Japanese audio studio Noisycroak about updating the classic Castlevania soundtrack for the latest ...

Traversing the Valley
In Walter Isaacsonʼs biography of Steve Jobs, Isaacson describes the time that Jobs cold called Wendell Weeks, the CEO of Corning, Inc., to learn ...

Man Travels Across Atlantic by Balloons: Real Life 'Up' Man Attempts Traversing Ocean with 300 Helium ...
A balloonist who said he'd cross the Atlantic Ocean using hundreds of helium-filled balloons landed in Newfoundland on Friday, missing his goal ...

How the Human Voice Is Traversing Society's Wellness-Tech Frontier
A recent study by IDC, reveals that in the year 2018, the wearable technology market will see about 111.9 million wearables being used around ...

Traversing the language barrier
Yerushalayim Torah Academy is providing an educational solution for teen olim who couldn’t adjust to the regular system.

Traversing the Labyrinth of Social Marketing Metrics
Businesses still struggle to hone in on the most appropriate social metrics. Far too many firms emphasize vanity metrics when there remains little ...

Resources last updated: 1/18/2016 5:17:40 AM