Traversing/Parsing XML file in PB - Need Help

This is a multi-part message in MIME format.

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


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.


//Load XML File

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
		xml_doc =
                s_text = xml_doc.NodeTypedValue
            //Set Quantity to 0
        END IF

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


8/19/2009 5:39:05 PM
sybase.powerbuilder.xml 546 articles. 0 followers. Follow

0 Replies

Similar Articles

[PageSpeed] 10


Similar Artilces:

XML::Parser XML::SimpleObject -> First XML parsing pls help
I took the example from 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

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: 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 <> has granted Benjamin Smedberg <>'s request for superreview: 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 ...

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 <> has asked Darin Fisher <> for superreview: 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 ...

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(""); 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: 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