[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

eXpat difficuties with attributes on iSeries



   Dear all,


   We are having difficulties to extract data from XML attributes with
   eXpat on the iSeries.

   The XML Elements are going fine.


   see: [1]http://www.w3schools.com/xml/xml_attributes.asp 

    

XML Elements vs. Attributes

   Take a look at these examples:

   <person sex="female">
     <firstname>Anna</firstname>
     <lastname>Smith</lastname>
   </person>

    

   <person>
     <sex>female</sex>
     <firstname>Anna</firstname>
     <lastname>Smith</lastname>
   </person>

   In the first example sex is an attribute. In the last, sex is an
   element. Both examples provide the same information.

   There are no rules about when to use attributes and when to use
   elements. Attributes are handy in HTML. In XML my advice is to avoid
   them. Use elements instead.


   When I pass this via Xpath I get the results:

   /person/firstname           Anna

   /person/lastname           Smith

   /person                        (something unreadable, hex25 - blank -
   blank -hex25 - blank - blank - hex25)


   How can we get the "sex" information from this example?


   [cid:image001.jpg@01CA11DF.2974A550]

   [cid:image002.jpg@01CA11DF.2974A550]


   Routine information:


   [cid:image003.jpg@01CA11DF.2974A550]


   Kind regards,


   [cid:image004.jpg@01CA11E3.34896B70]


   Hendrik Kroon
   Software Engineer
   IBIS Management Associates Inc.


   office Curacao : +5999-737 2065 x 633
   office Miami    : +1305-767 2875 x 633
   fax                     : +5999-737 2048
   cell                    : +5999-5276543
   email : hendrik.kroon[2]@ibis-management.com
   Visit us online at [3]www.ibis-management.com

                    [cid:image005.jpg@01CA11E3.34896B70]

References

   1. http://www.w3schools.com/xml/xml_attributes.asp
   2. mailto:Morales.Esajas@xxxxxxxxxxxxxxxxxxx
   3. http://www.ibis-management.com/

JPEG image

JPEG image

JPEG image

JPEG image

JPEG image

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------