Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML and WDDX 2

Status
Not open for further replies.

PetersWeb

Programmer
Apr 26, 2000
29
AU
I've got both Ben Forta books and have managed to work my way throught the WDDX examples successfully.<br><br>My question is this:<br><br>The company I work for publishes information using XML files.&nbsp;&nbsp;How do I convert an XML file to WDDX?&nbsp;&nbsp;Do I need to?<br><br>Please help. <p>Peter Toby<br><a href=mailto:webmaster@petertoby.com.au>webmaster@petertoby.com.au</a><br><a href= site is under construction
 
WDDX is for storing packets or information, such as the contents of an Array or a query, so that it can be used by other platforms.<br><br>If your XML that you want to convert to WDDX has an array or some data then you can use the WDDX Javascript SDK to convert this data into a WDDX packet and submit as a formfield to the CFM template.<br><br>goto <A HREF=" TARGET="_new"> and download the SDK.<br><br> <p>Russ Michaels<br><a href=mailto:russ@satachi.com>russ@satachi.com</a><br><a href= Internet Development</a><br>Rapid Web application development, specialising in Coldfusion, database integration and e-commerce solutions.
 
I've tried and failed.&nbsp;&nbsp;<br><br>The XML file I has contains many more of the following:<br><br><br>&lt;mynews title=&quot;Top_Ten_News&quot; date=&quot;20000614&quot;&gt;<br> &lt;news&gt;<br> &lt;author&gt;Mark Todd&lt;/author&gt;<br> &lt;articleid&gt;2000061401&lt;/articleid&gt;<br> &lt;timestamp&gt;14 June 2000&lt;/timestamp&gt;<br> &lt;source&gt;Sydney Morning Herald&lt;/source&gt;<br> &lt;tagline&gt;PAGE 27&lt;/tagline&gt;<br> &lt;headline&gt;Brambles rejig to curb profit&lt;/headline&gt;<br> &lt;fullstory&gt;<br>On 13 June 2000, analysts downgraded their profit forecasts for Brambles Industries Limited to reflect an anticipated reshaping of operations.&nbsp;&nbsp;This has resulted in forecasts of Brambles&apos; net profit growth next financial year being lowered to 8% to 10%.&nbsp;&nbsp;Some analysts are bracing for a similarly subdued performance in 2001-02.&nbsp;&nbsp;The revisions stem from a belief that the Australian conglomerate will unveil a five-year plan in August, mapping out its strategy through to 2006.&nbsp;&nbsp;Sales of non-core assets such as its security business, CAIB rail wagon rental in Europe and forklift rental are expected to be central to the plan.&nbsp;&nbsp;The strategy will include relocating the head office to Washington DC and placing the Eurotainer division into a joint venture.&nbsp;&nbsp;Brambles may even decide to reduce its five core businesses to four, with equipment rental the most obvious candidate for sale.&nbsp;&nbsp;Brambles will then be able to concentrate on its higher growth assets:&nbsp;&nbsp;CHEP pallet hire and container management;&nbsp;&nbsp;Recall document management;&nbsp;&nbsp;Cleanaway waste services, and industrial services<br> &lt;/fullstory&gt;<br> &lt;/news&gt;<br> &lt;news&gt;<br> &lt;author&gt;Anne Davies&lt;/author&gt;<br> &lt;articleid&gt;2000061402&lt;/articleid&gt;<br> &lt;timestamp&gt;14 June 2000&lt;/timestamp&gt;<br> &lt;source&gt;Sydney Morning Herald&lt;/source&gt;<br> &lt;tagline&gt;PAGE 29&lt;/tagline&gt;<br> &lt;headline&gt;Optus keen on new PBL talks&lt;/headline&gt;<br> &lt;fullstory&gt;<br>Australian telecom carrier Cable &amp; Wireless Optus is keen to reopen talks with Publishing &amp; Broadcasting Ltd about a possible $A8bn joint venture.&nbsp;&nbsp;Sources said on 13 June 2000 that Optus chief executive Chris Anderson was keen to rekindle talks involving the company&apos;s broadband pay television cable business, which failed six weeks ago due to an impasse on a central element of the deal.&nbsp;&nbsp;The reason for the change of heart may lie in the lack of other serious proposals to co-operate with Optus on its cable business.&nbsp;&nbsp;The $A8 billion deal that PBL and Optus had been discussing involved Optus contributing its $A4 billion pay television cable network and taking a 50% share, while PBL subsidiary ecorp Limited was to contribute its top-rating Web site, ninemsn.&nbsp;&nbsp;PBL and Microsoft Corp would have each emerged as 25% shareholders in the vehicle, which they had planned to float<br> &lt;/fullstory&gt;<br> &lt;/news&gt;<br> &lt;/news&gt;<br>&lt;/mynews&gt;<br><br>How do I render it using WDDX???<br> <p>Peter Toby<br><a href=mailto:webmaster@petertoby.com.au>webmaster@petertoby.com.au</a><br><a href= site is under construction but getting better!
 
If you've already formatted this into XML, as shown: <mynews><news><fullstory></fullstory></news></mynews>

then incorporating WDDX is not necessary.

CFWDDX is simply to convert data sets you already have within CF variables (structure, arrays, or query record sets) into an XML standard. Serializing from CF into WDDX or deserializing from WDDX to CF is only necessary if you need to package up data for transmission.

If you already receive data in XML format, obviously yuor company has its own standard. How you parse and display this though is now on your shoulders as the developer. WDDX was introduced so that you could say, collect an XML dataset and convert it into an array that you could then loop through using CF.

If you've decided on CF as your standard to format the XML for output, then you should use WDDX. All that means is that whatever process produces your XML in that format you included, they should either let CF query that data and display it directly, or change their XML standard and write it like WDDX :
<wddxPacket version='1.0'><header></header><data><array length='6'><array length='2'><string>Classifides</string><string>classf</string></array></data></wddxPacket>

ELSE! you have to actually program the parser to understand the XML.

hope this helps you make your decision. if you're using CF for XML, id recommend WDDX.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top