ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General Discussion » What is the worst XML Structure you have come upon?

Post new topic  Reply to topic
 What is the worst XML Structure you have come upon? « View previous topic :: View next topic » 
Author Message
smdavies99
PostPosted: Mon Oct 05, 2015 11:26 pm    Post subject: What is the worst XML Structure you have come upon? Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Ok, lets have a little discussion on this.

One of my customers has just issued a change request to change the output structure from this
Code:

<data>
  <Item>
     <ItemName>Saucerful</ItemName>
     <Qty>21</Qty>
  </Item>
  <Item>
     <ItemName>Atom</ItemName>
     <Qty>15</Qty>
  </Item>
  <Item>
     <ItemName>DSOTM</ItemName>
     <Qty>1</Qty>
  </Item>
</data>

to what can only be described as JSONified XML
Code:

<data>
  <Saucerful>21</Saucerful>
  <Atom>15</Atom>
  <DSOTM>1</DSOTM>
</data>


And yest, they are still insisting that is it validated against a schema before I send it to them.
given that the number and names of the XML Tags are variable I really don't think that I can do a validation.
The changes are very simple to do but the validation requirement is going to lead me to reject the CR for that reason alone.

So, lets have examples (obfuscated naturally) that have left you scratching your head in <add your reason here>

{for some reason the [C O D E] tags don't seem to be working}
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Oct 06, 2015 5:08 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I'll leave you to adjust your [ c o d e ] tags appropriately ...

There was quite a while when it was fashionable to create xml like
Code:
<document><root><record><element name="saucerful" value="21"/><element name="Atom" value="15"/> ... etc...
because of some weird java mapping standard or sommat other terrible idea.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
stoney
PostPosted: Tue Oct 06, 2015 8:54 am    Post subject: Reply with quote

Centurion

Joined: 03 Apr 2013
Posts: 140

Code:
<?xml version="1.0" encoding="UTF-8"?>
<json:object xsi:schemaLocation="http://www.datapower.com/schemas/json jsonx.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:json="http://www.ibm.com/xmlns/prod/2009/jsonx">
  <json:string name="name">John Smith</json:string>
  <json:object name="address">
    <json:string name="streetAddress">21 2nd Street</json:string>
    <json:string name="city">New York</json:string>
    <json:string name="state">NY</json:string>
    <json:number name="postalCode">10021</json:number>
  </json:object>
  <json:array name="phoneNumbers">
    <json:string>212 555-1111</json:string>
    <json:string>212 555-2222</json:string>
  </json:array>
  <json:null name="additionalInfo" />
  <json:boolean name="remote">false</json:boolean>
  <json:number name="height">62.4</json:number>
  <json:string name="ficoScore"> > 640</json:string>
</json:object>
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » What is the worst XML Structure you have come upon?
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.