Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: XML to Hash Truncating Keys Problem

by Wayne (Novice)
on Mar 28, 2019 at 21:01 UTC ( #1231834=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my($xml)='<?xml version="1.0"?>
    <root><order><id>359</id><order_number>359</order_number><created_at>2
    +019-03-28 10:33:06</created_at><updated_at>2019-03-28 10:33:06</updat
    +ed_at><completed_at/><status>pending</status><currency>CAD</currency>
    +<total>12.00</total><subtotal>12.00</subtotal><total_line_items_quant
    +ity>3</total_line_items_quantity><total_tax>0.00</total_tax><total_sh
    +ipping>0.00</total_shipping><cart_tax>0.00</cart_tax><shipping_tax>0.
    +00</shipping_tax><total_discount>0.00</total_discount><shipping_metho
    +ds>Pickup</shipping_methods><order_key>wc_order_n13C7qFcbVcbI</order_
    +key><payment_details><method_id>cop</method_id><method_title>Pay at P
    +ickup</method_title><paid_at/></payment_details><billing_address><fir
    +st_name>Joe</first_name><last_name>Blow</last_name><company_name/><ad
    +dress_1>123 Somestreet</address_1><address_2/><city>Moncton</city><pr
    +ovince_code>NB</province_code><province>New Brunswick</province><post
    +al_code>E4E 4E4</postal_code><country_code>CA</country_code><country>
    +Canada</country><email>someone@somewhere.com</email><phone>5065551212
    +</phone></billing_address><shipping_address><first_name>Joe</first_na
    +me><last_name>Blow</last_name><company_name/><address_1>123 Somestree
    +t</address_1><address_2/><city>Moncton</city><province_code>NB</provi
    +nce_code><province>New Brunswick</province><postal_code>E4E 4E4</post
    +al_code><country_code>CA</country_code><country>Canada</country></shi
    +pping_address><note/><customer_ip>127.0.0.1</customer_ip><customer_us
    +er_agent>Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 
    +(KHTML, like Gecko) Chrome/127.0.0.1 Safari/537.36</customer_user_age
    +nt><customer_id>1</customer_id><view_order_url>https://www.mysite.com
    +/my-account/view-order/359/</view_order_url><line_items><id>307</id><
    +subtotal>10.00</subtotal><subtotal_tax>0.00</subtotal_tax><total>10.0
    +0</total><total_tax>0.00</total_tax><price>10.00</price><quantity>1</
    +quantity><tax_class/><name>Pepperoni Pizza</name><product_id>15</prod
    +uct_id><variation_id>0</variation_id><product_url>https://www.mysite.
    +com/product/pepperoni-pizza/</product_url><product_thumbnail_url>http
    +s://www.mysite.com/wp-content/uploads/2019/03/pepperoni-pizza-150x150
    +.jpg</product_thumbnail_url><sku/><meta/><id>308</id><subtotal>2.00</
    +subtotal><subtotal_tax>0.00</subtotal_tax><total>2.00</total><total_t
    +ax>0.00</total_tax><price>1.00</price><quantity>2</quantity><tax_clas
    +s/><name>Pepsi</name><product_id>222</product_id><variation_id>0</var
    +iation_id><product_url>https://www.mysite.com/product/pepsi/</product
    +_url><product_thumbnail_url>https://www.mysite.com/wp-content/uploads
    +/2019/03/pepsi-can-150x150.jpg</product_thumbnail_url><sku/><meta/></
    +line_items><shipping_lines><id>309</id><method_id>local_pickup</metho
    +d_id><method_title>Pickup</method_title><total>0.00</total></shipping
    +_lines><tax_lines/><fee_lines/><coupon_lines/></order></root>';
    
  2. or download this
    {
      'root' => {
    ...
                 'version' => '1.0'
               }
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1231834]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2021-06-21 16:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (99 votes). Check out past polls.

    Notices?