On 11/24/2010 2:15 PM, Steve Long wrote:
Steve -

Can you provide a sample of your code so I can see the steps you are
taking?  I might be able to help.

Thanks,

Steve Long

Spyderweb Techincal Services, Inc.
(360) 687-8797 Office
(866) 354-5913 Fax
www.spyderwebtech.net

Hi Steve,

I broke my problem down into a smaller HelloWorld and was able to write to _XML_ so I am sure I have a problem in my application. I am on the trail!

BTW, ported Gregor's method to Unidata.  That is the DEFFUN I am using.
http://gdoesu2.wordpress.com/2010/10/25/an-easier-way-to-build-xml-in-universe/

This example works.

$BASICTYPE "U"
* manual build of xml using XDOM
$INCLUDE USER.INCLUDE XML.H
* Define the function we are going to use
DEFFUN ADD_XML_ELEMENT(a,b,c,d,e,f)

doc.XML = ""

* Trying to build xml:
* <PurchaseHistory>
* <PurchaseItem Ref="ABC123">Learning the Ropes</PurchaseItem>
* <PurchaseItem Ref="CODE86">Getting Smarter</PurchaseItem>
* <PurchaseItem Ref="CODE007" Security="High">Bonding the James Way</PurchaseItem>
* </PurchaseHistory>

* Create the doc
xmlStatus = XDOMCreateRoot(domHandle)

* Add the root element
xmlStatus = ADD_XML_ELEMENT( domHandle, "PurchaseHistory", "", "", "", newnode)

* add the PurchaseItem elements
attrNode = "Ref": @AM: "ABC123"
xmlStatus = ADD_XML_ELEMENT( newnode, "PurchaseItem", "Learning the Ropes", attrNode, "", subnode)
xmlStatus = XDOMClose(subnode)
attrNode = "Ref": @AM: "CODE86"
xmlStatus = ADD_XML_ELEMENT( newnode, "PurchaseItem", "Getting Smarter", attrNode, "", subnode)
xmlStatus = XDOMClose(subnode)
attrNode = "Ref":@VM:"Security": @AM: "CODE007": @VM: "High"
xmlStatus = ADD_XML_ELEMENT( newnode, "PurchaseItem", "Bonding the James Way", attrNode, "", subnode)
xmlStatus = XDOMClose(subnode)

* Output the XML
xmlStatus = XDOMWrite( domHandle, doc.XML, XML.TO.STRING)
CRT "XML = "
CRT "[":doc.XML:"]"
FOUT.NAME = "SBR.xml"
xmlStatus = XDOMWrite( domHandle, FOUT.NAME , XML.TO.FILE)

xmlStatus = XDOMClose(newnode)
xmlStatus = XDOMClose(domHandle)


Thanks though.
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to