format xml data


grasping straws here, newbi spry , xml. trying display numbers xml file. have number ei. 25450 need display $25,450.00.

question #1 format in xpath statement? or add xsl file?? below, please find sample form xml file. <price> element need format.

question #2 how first jpg <image> node, (order = “1”). separate dataset?

my xpath var dstoys = new spry.data.xmldataset("../images/rvusa/database_export.xml", "inventory/dealer/location/units/unit[type ='toy hauler']");


<inventory>
<dealer>
<id>422</id>
<name><![cdata[client]]></name>
<location>
<id>458</id>
<address>11572 road</address>
<city>any town</city>
<state>wa</state>
<zipcode>98000</zipcode>
<phone>123-123-1234</phone>
<units>
<unit>
<id>482252</id>
<type><![cdata[park model]]></type>
<condition><![cdata[new]]></condition>
<stock_number><![cdata[1865]]></stock_number>
<year><![cdata[2008]]></year>
<manufacturer><![cdata[kropf]]></manufacturer>
<model><![cdata[sesrlp]]></model>
<length>36</length>
<msrp>0</msrp>
<price>61545</price>
<sale_price>0</sale_price>
<description><![cdata[large bathroom walk-in laundry room. front living room, nice entertainment center. residential appliances, 8" i-beam chassis full outriggers, 2x4 sidewall framing 16" on-center. 50 year vinyl siding, fiberglass insulation r-22 in roof, r-11 in sidewalls , floor.]]></description>
<chassis><![cdata[]]></chassis>
<engine_manufacturer><![cdata[]]></engine_manufacturer>
<engine_model><![cdata[]]></engine_model>
<fuel_type><![cdata[]]></fuel_type>
<interior_color><![cdata[rustic]]></interior_color>
<exterior_color><![cdata[tan]]></exterior_color>
<sleep_capacity />
<water_capacity />
<num_air_conditioners>1</num_air_conditioners>
<mileage />
<trailer_weight />
<num_slideouts>0</num_slideouts>
<vin><![cdata[]]></vin>
<is_special><![cdata[false]]></is_special>
<is_sold><![cdata[false]]></is_sold>
<is_consignment><![cdata[false]]></is_consignment>
<is_new_arrival><![cdata[false]]></is_new_arrival>
<is_on_deposit><![cdata[false]]></is_on_deposit>
<is_on_order><![cdata[false]]></is_on_order>
<images>
<image order="1"><![cdata[ http://mydomain.com/images/482252_1.jpg
<image order="2"><![cdata[ http://mydomain.com/images/482252_2.jpg
<image order="3"><![cdata[ http://mydomain.com/images/482252_3.jpg
<image

this may out of control, , i'm no expert myself, think xml sample isn't well-formed. if you've created javascript xml object, should able reference specific child node calling name. check dreamweaver documentation appropriate call. dreamweaver dom. might some.

xml unforgiving, if of it's structure isn't right, may not error message tell went wrong. ended parsing xml file using javascript string object's functions extract nodes needed. evenutally, ended creating own xml editor extension.

getting xml, use lowercase. personally, use more attributes parent nodes nest other nodes , close them off sooner. enter price attribute of stock item. when price extracted file display user, format display field propper currency type. might want add "currency" attribute tell formatter how convert , display price.

<inventory>
<item id="482252" stocknumber="1865" price="25450.00" currency="us">
<dealer id="422" name="client" location="458">
<address city="any town" state="wa" zip="98000" />
</dealer>
<description><![cdata[text goes here]></description>
<engine>
<manufacturer></manufacturer>
<model></model>
<fueltype></fueltype>
<length></length>
</engine.
</item>
<item id="">
[another one]
</item>
</inventory>

hope helps.


More discussions in Dreamweaver extensions


adobe

Comments

Popular posts from this blog

VIDIOC_S_FMT error 16, Device or resource busy - Raspberry Pi Forums

using a laptop skeleton to build a pi laptop - Raspberry Pi Forums

Forum for Joomla? - Joomla! Forum - community, help and support