XML Export #2

Hi all,

PB 11.5.1.

Can anyone explain me in a few words what to do if i want to
export to XML please ?

I have 4 tables , one main , the second is child of the
first, the third is a child of the second and the fourth is
a child of the third.

A few questions

1) how to deal with multiple child tables which need to be
exported in 1 xml message ?

2) how to connect the database column name to an xml element
?

3) how to make a single or multiple columns belong to an xml
group ?

That's it for now ....

TIA
John
0
John
4/19/2010 12:21:47 PM
sybase.powerbuilder.xml 546 articles. 0 followers. Follow

1 Replies
518 Views

Similar Articles

[PageSpeed] 2

We use PB 11.5.1.

I use a nested set of DW objects to create the combined XML document.
Each DW object has at least one "XML template" defined.
At design time we defined which XML template to use for export. You may 
change templates at runtime.
The DataWindow acting as the outer report exports its XML and thereby 
includes all the nested data.

You must manipulate the XML returned by the DataWindow since it may conflict 
with the required XML format of the receiver.
We found the following issues in XML exported from a DW object (originally 
coded in PB 10.5.2 then migrated and expanded in PB 11.5.1):
Issue #1: Nested DataWindows always add an invalid "NULL item".
Issue #2: NULL values specified incorrectly.
Issue #3: Regional settings and computed expressions may use "," as decimal 
point where XML required "."
Issue #4: It is common to simply skip XML items containing the empty text. 
DW cannot do so.
Issue #5: It os common to skip empty collections when no "rows" exist.
Issue #6: Timestamps may require timezone.

For each issue we created a function that encapsulates all required 
processing. All functions created on our custom XML processor 
n_xml_processor.
Code to execute (we use PFC where n_ds is the datastore. snv_XML refers to 
shared instance of n_xml_processor):

// - - - - Locals
    n_ds lds_Data
    string ls_KeyValue
    string ls_XMLData
    string ls_XMLElement_IgnoreIfEmpty [ ]
    string ls_XMLElement_LocalTime [ ]
    string ls_XMLElement_OptionalCollections [ ]

// Initialization
    ls_KeyValue = dw_DataEntry.GetItemString( 1, "key_value")
    ls_XMLElement_IgnoreIfEmpty = {"UseCode", "ProjectEndDate", 
"ProjectPhaseCategoryCode", . . . }
    ls_XMLElement_LocalTime = { "DeliveryNotBefore", "DeliveryNotAfter", . . 
.. }
    ls_XMLElement_OptionalCollections = { "ProjectPhase", "Project", 
"Delivery", . . . }

// - - - - Extract data from DB
    lds_Data = CREATE n_ds
    lds_Data.DataObject = "d_maintable_xml"
    lds_Data.Retrieve( ls_KeyValue )

// - - - - Transform to XML
    ls_XMLData = lds_Data.object.DataWindow.Data.Export.XML
    ls_XMLData = snv_XML.of_FixNestedCollections( ls_XMLData )
    ls_XMLData = snv_XML.of_FixNULLValues( ls_XMLData )
    ls_XMLData = snv_XML.of_FixDecimalPoint( ls_XMLData )

// - - - - Process XML to fit the needs of the receiver
    // NOTE: The functions require list of XML elements to indicate which to 
process
    ls_XMLData = snv_XML.of_RemoveEmptyElements( ls_XMLData, 
ls_XMLElement_IgnoreIfEmpty )
    ls_XMLData = snv_XML.of_RemoveEmptyCollections( ls_XMLData, 
ls_XMLElement_OptionalCollections )
    ls_XMLData = snv_XML.of_AddTimezone( ls_XMLData, 
ls_XMLElement_LocalTime )


HTH
/MicKr-



<John> wrote in message news:4bcc4ada.6971.1681692777@sybase.com...
> Hi all,
>
> PB 11.5.1.
>
> Can anyone explain me in a few words what to do if i want to
> export to XML please ?
>
> I have 4 tables , one main , the second is child of the
> first, the third is a child of the second and the fourth is
> a child of the third.
>
> A few questions
>
> 1) how to deal with multiple child tables which need to be
> exported in 1 xml message ?
>
> 2) how to connect the database column name to an xml element
> ?
>
> 3) how to make a single or multiple columns belong to an xml
> group ?
>
> That's it for now ....
>
> TIA
> John 


0
Michael
5/6/2010 7:10:18 PM
Reply:

Similar Artilces:

XML in, XML out
Hi All (and a happy holiday to those that will get a break), I am trying to read in an XML file of addresses. I need to remove all the address data from the file where code =~ /^000/ (there are none in the example data below). I need to reproduce that data 'as is', so I need to honour the tag structure, although the order of the tags doesn't need to be honoured. I have been trying to use XML::Simple and I had a go with XML::Smart but I haven't been able to get the results I want. My best effort is below (with XML::Simple). There are a couple of differences ...

XMl to XML
Hello,   I retrieved an XML from the dataset which retrieves data from the table in the database. I need to present the data  in a different structure. Is XSLT the way or are there any other options. please let me know. Thanks!! Yes XSLT is a good choice to convert xml file to other forms. You can take a look at XSLT Tutorial.Sincerely,Young Fang...

Bugzilla 2.2x: Can I export all of my bugs into XML (bug-centric XML; no table-centric)
Background: * to migrate a customized 2.20 to 3.0 bugzilla. * remove the customizations in our new server (drop customized fields since no one really uses them) * restructure our classifications, layouts, and components So basically, I'm in the middle of a data migration as well as an upgrade. I'm trying to find the best way to migrate the old data to the new. My assumption that I'm operating with is that the customizations are forcing me to migrate the data just like I would if I were coming from a different bug tracking application. I don't think I like the ide...

1 Xml -> 2 DataWindows; 2 DataWindows -> 1 Xml
Hi Is it possible to import an Xml file like <data> <dataX>...</dataX> <dataV>...</dataV> <dataV>...</dataV> <dataV>...</dataV> ... <dataV>...</dataV> </data> to one Datawindow ? On the other hand is it easily possible to assemble data from two Datawindows in one XML file ? thanks Thomas Kovasits Thomas Kovasits wrote: > Hi > Is it possible to import an Xml file like > <data> > <dataX>...</dataX> > <dataV>...</dataV> > &l...

XML::Parser XML::DOM XML::XSLT
------_=_NextPart_001_01C6E0D0.3E27D77A Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Hi Craig and fellow VMS Perlers, You last wrote about this Fri 3/16/2001 11:24 AM, not counting your very helpful comments on Eisner/Decuserve more recently. One of my colleagues sent me an email requesting that I make XML::XSLT=20 available on VMS. perl 5.8.6, VMS 7.3-2, DECC 7.1 latest ACRTL (version 3) on Alpha XML::XSLT (version 0.48) depends on XML::Parser (version 2.34). This depends on expat (version 2.0.0). I built expat a...

superreview requested: [Bug 282180] sync xpfe button.xml with toolkit button.xml : [Attachment 218477] (Av3-XPFE) <button.xml> #2
Serge GAUTHERIE <gautheri@noos.fr> has asked neil@parkwaycc.co.uk <neil@httl.net> for superreview: Bug 282180: sync xpfe button.xml with toolkit button.xml https://bugzilla.mozilla.org/show_bug.cgi?id=282180 Attachment 218477: (Av3-XPFE) <button.xml> https://bugzilla.mozilla.org/attachment.cgi?id=218477&action=edit ...

superreview requested: [Bug 282180] sync xpfe button.xml with toolkit button.xml : [Attachment 221700] (Av4-XPFE) <button.xml> #2
Serge GAUTHERIE <gautheri@noos.fr> has asked neil@parkwaycc.co.uk <neil@httl.net> for superreview: Bug 282180: sync xpfe button.xml with toolkit button.xml https://bugzilla.mozilla.org/show_bug.cgi?id=282180 Attachment 221700: (Av4-XPFE) <button.xml> https://bugzilla.mozilla.org/attachment.cgi?id=221700&action=edit ...

creating an XML document using xml::dom #2
I am trying to recreate some code written in C# using perl. The goal is = to create an XML formatted login packet and post it to http webserver = and then parse the response. My first hurdle I think is to create the = XML login packet. =20 Here is the sample of what the login packet is supposed to look like <header> </header> <data> <struct> <var name=3D'USERID'><string>john.doe</string></var> <var name=3D'USERPASSWORD'><string>FAKEPASSWD</string></var> <var name=3D'PARTNERID'>...

XML processing of large XML docs pt. 2
First of all, thanks to all of you who supplied comments and suggestions for my issue relating to parsing very large XML documents with complex structures. Given those suggestions, I was able to find a solution. Believe it or not, the solution was to use a Perl API that relied upon a C library for parsing the XML, as opposed to a pure Perl solution. In this case, I used XML::LibXML (which is an API to the Gnome libxml2 C library). It is an understatement to say that the processing speed, after running several tests, was improved by many orders of magnitude. I'm now able to...

XML to XML transform
Hi all, I have an XML file in which I just want to change a couple of values.  So, the end result is a new file with exactly the same XML structure.  I am new to XML and XSLT, so I thought I'd start off with something simple; I created an xsl file that would just copy the source directly across without modifying the values (I can do this later, once I have the first bit figured) - <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:con="http://eviware.com/soapui/config"><xsl:template match="/"...

Transform XML to XML
I've been trying to transform an XML document to another XML document. The original document is very large (6megs) and the application that needs to use it only needs a fraction of the data. I'm trying to take this mother-of-all XML documents and filter out unwanted nodes. I could probably do this very easily with code by running a few XPath Queries against the document, and placing the results in a new document...however...I have an interest in learning how to do this with XSL. In the past, I've done some pretty basic XML to HTML transformation ans that worked out well. This ti...

How to select Xml as Xml?
If I select Xml nodes like this from sql server; select xmlData.query('//Field[@F = "True"]') as extendedInfo from.... ..how to loop through the items in C#? I can't cast it to a System.Xml.XmlNodeList..? You can use the XmlDocument class.  There's a Load method and a LoadXml method.  One of these should get you what you want, after which you can select nodes as you need.C# <---> VB.Net Translator mm8: If I select Xml nodes like this from sql server; select xmlData.query('//Field[@F = "True"]') as extendedInfo from.... ...

XML Export Template question regard XML format
Hi. I am using the XML Export Template in PB9.0 to produce an XML file. So far so good. The only problem is that it is producing a XML file of the following form: <DOC_CAT Attribute="Y"> <![CDATA[ABS]]]> </DOC_CAT> I need to have everything on one line, i.e. <DOC_CAT Attribute="Y"><![CDATA[ABS]]]></DOC_CAT>. Is there some setting on the XML Export template I can use to achieve this? Any info would be greatly appreciated:) Make sure you uncheck the "Include Whitespace" option on the DataWindow Export t...

sort xml in xml
Hi, How I can sort xml file in xml with VB.NetThanks,<?xml version="1.0" encoding="ISO-8859-1" ?>  <Liste>   <Form Famille="Administration" idXhtml="" idOffice="31574" nom="ADM" desc="" />   <Form Famille="Admini" idXhtml="" idOffice="31708" nom="ADM- 54 (2000)" desc="" />   <Form Famille="communication" idXhtml="" idOffice="31709" nom="ADM- 133 (2000)" desc="" />   <Form Famille="Admini" idXhtml="" idOffice="31710" nom="ADM- 9 (2000)" desc="" />   <Form Famille="Admini" idXhtml="" idOffice="31711" no...

Web resources about - XML Export #2 - sybase.powerbuilder.xml

Export - Wikipedia, the free encyclopedia
An export of a good occurs when there is a change of ownership from a resident to a non-resident; this does not necessarily imply that the good ...

Export - Wikipedia, the free encyclopedia
An export of a good occurs when there is a change of ownership from a resident to a non-resident; this does not necessarily imply that the good ...

Facebook To Developers: No Using Platform To Export User Data To Other Social Networks
Facebook issued a stern reminder to developers that its platform cannot be used to export user data to other social networks without permission. ...

Facebook Users Can Now Opt Into Letting Friends Export Their Email Addresses via Download Your Information ...
Previously, Facebook's Download Your Information tool let users export an archive of their status updates, photos, as well as a list of friends' ...

Thread: Why is Twitter letting us export?
... Instagram and how they own your pictures (not mine, I never used the service) it raises the question as to why Twitter is letting us export ...

Export Import Business Group
Here we are, people in the business of export and import from all over the world. I invite you people also to join for more info of the business ...

iDindi 2 HD - Money & Expenses Under Control (Sync & Export Excel) for iPad on the iTunes App Store
Get iDindi 2 HD - Money & Expenses Under Control (Sync & Export Excel) on the App Store. See screenshots and ratings, and read customer reviews. ...

Roy Hill ready to start exports
Gina Rinehart’s $10 billion iron ore project set for first exports next week.

Exports lift GDP growth to 2.5 per cent year-on-year
... 0.9 per cent after a weak June quarter. Economic growth in the third quarter bounced back to 0.9 per cent after a weak June quarter, with exports, ...

Wine: Georgia's most popular export thrives in embargo
How Russia inadvertently promoted Georgian wine in the West.

Resources last updated: 12/8/2015 7:24:22 PM