Recently I had to compose some XML documents that needed to be validated with XSDs. All fine of course, but I had some problem with two date/time fields that according to the XSD were supposed to be xs:dateTime fields. Googling around I found a lot of references to the ISO8601 format, so I decided to format my date using the DATE_ISO8601 constant. That did not work though.
posted on September 8, 2009 - 3 comment(s) - tags: php, xsd, validation, xml, datetime
Earlier on I had a problem with namespaces for getting XML attributes. When I finally got that sorted, I ran into an even weirder problem when fetching elements using xpath. Again, it was just a tiny little detail.
posted on June 3, 2008 - 0 comment(s) - tags: xml, namespace, simplexml, xpath, php
I've so far worked only very little with XML with namespaces, especially in terms of parsing it. Therefor, I was quite stumped today on the parsing of a particular snippet of XML which contained an element that had an xlink:href attribute. I just couldn't get that attribute's value out. The solution, as often seems to be the case, is quite simple.
posted on May 30, 2008 - 8 comment(s) - tags: simplexml, xml, namespaces, php