Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Kore Nordmann's Blog:
Generating XML schemas from XML data
Mar 29, 2011 @ 17:16:05

In a new post to his blog Kore Nordmann talks about a tool he's developed that will "learn" XML schemas based on a document it's given. The tool, the XML-schema-learner, makes it as simple as a one-line command to generate the DTD file and transform it into a schema.

You can get the "XML schema learner" from my Github account: https://github.com/kore/XML-Schema-learner. Just clone it, and you can run the tests, or use the learn command to infer XML schemas from XML data.

He includes an example XML definition and the resulting DTD that the tool generates from it, defining each of the elements and attributes each can have. The tool can then take this DTD file and generate an XSD file, creating complex and simple types that match the original data.

tagged: generate xml data xmlschemalearner github dtd xsd

Link:

Stefan Koopmanschap's Blog:
Formatting valid xs:dateTime fields with PHP
Sep 09, 2009 @ 14:19:15

Stefan Koopmanschap had a problem - the formatting on his dateTime fields (the XSD type) wasn't cooperating and couldn't be validated. He asked the question of the community of how to correct this and was given a short and easy answer from David Zuelke using date.

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.

David's suggestion was to use "date('c')" (the full ISO 8601 date) instead of the DATE_ISO8601 constant. The trouble is caused by a missing colon in the second choice's output.

tagged: format valid xsd datetime

Link:


Trending Topics: