Novice working with attributes

  • I have received no responses working with other forums on this issue so I hope this forum will be the answer.

    This is the first time I have dealt with a "method", and I can't figure out how to "assign" the value. I have attached my .xsd, as a .txt, and examples (as well as displaying below) of the XML that gets generated by a test harness (supplied by a different company) and what I get. I use Altova MapForce (2011) (attach as a picture) to map the data and that might be the issue. Any insight on Altova or the other bits would be greatly appreciated.

    XSD

    <?xml version="1.0" encoding="UTF-8"?>

    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:element name="event-entry"> <!-- <event-entry> -->

    <xs:complexType>

    <xs:sequence>

    <xs:element name="measure-up"><!-- <measure-up> -->

    <xs:complexType>

    <xs:sequence>

    <xs:element name="measure-up-id" type="xs:string"/> <!-- <measure-up-id></measure-up-id> -->

    <xs:element name="date" type="xs:string"/> <!-- <date>03/17/2015 07:59:50 PM</date> -->

    <xs:element name="container-id" type="xs:string"/> <!-- <container-id>4028e4874391198e0143917e3ce00029</container-id> -->

    <xs:element name="productDescription"> <!-- <productDescription> -->

    <xs:complexType>

    <xs:sequence>

    <xs:element name="oid" type="xs:string"/> <!-- <oid>4028e4874565c0b401456656ca850024</oid> -->

    </xs:sequence>

    </xs:complexType>

    </xs:element> <!-- </productDescription>-->

    <xs:element name="measurement"> <!-- <measurement -->

    <xs:complexType>

    <xs:attribute name="method" type="xs:string"/> <!-- method="air-space">110< -->

    </xs:complexType>

    </xs:element> <!-- </measurement> -->

    <xs:element name="uom" type="xs:string"/> <!-- <uom>ft</uom>< -->

    <xs:element name="comment" type="xs:string"/> <!-- <comment></comment> -->

    </xs:sequence>

    </xs:complexType>

    </xs:element> <!-- </measure-up></event-entry> -->

    </xs:sequence>

    </xs:complexType>

    </xs:element> <!-- </event-entry> -->

    </xs:schema>

    TEST HARNESS

    <event-entry>

    <measure-up>

    <measure-up-id></measure-up-id>

    <date>03/20/2015 04:30:55 AM</date>

    <container-id>4028e4874391198e0143917e3ce00029</container-id>

    <productDescription>

    <oid>4028e4874565c0b401456656ca850024</oid>

    </productDescription>

    <measurement method="air-space">100</measurement>

    <uom>ft</uom>

    <comment></comment>

    </measure-up>

    </event-entry>

    MINE

    <?xml version="1.0" encoding="utf-16"?>

    <event-entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:/Jobs/Kalama/XSDDEF~1/Map65MeasureUp_POST.xsd">

    <measure-up>

    <date>03/18/2015 02:13:01 PM</date>

    <container-id>4028e4874391198e0143917e3ce00029</container-id>

    <productDescription>

    <oid>4028e4874565c0b401456656ca850024</oid>

    </productDescription>

    <measurement method="air-space" />

    <uom>ft</uom>

    </measure-up>

    </event-entry>2015-03-20 04:21:35.6130000

    as you can see, in my result there is no value for <measurement>

    If it seems like I am talking crazy let me know, my understanding of what all this is is slim

    <><
    Livin' down on the cube farm. Left, left, then a right.

Viewing 0 posts

You must be logged in to reply to this topic. Login to reply