php and xsd
Moderator: General Moderators
php and xsd
Hi,
I have a xsd file and need to create a parser or something to be able to read the information in a "friendly" way.
This xsd file contain a list of attributes that will be used on a form.
I searched the web for hours but cannot find anything about xsd.
s
I have a xsd file and need to create a parser or something to be able to read the information in a "friendly" way.
This xsd file contain a list of attributes that will be used on a form.
I searched the web for hours but cannot find anything about xsd.
s
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
your not understanding it isn't my problem. The ability to parse xml is all there for you using those functions: http://php.net/xml
there have been at least a few threads on xml parsers here.. timvw participated in one..
there have been at least a few threads on xml parsers here.. timvw participated in one..
I've yet to encounter a working example of a PHP xml script that can actually make use of an xsd or xsl file. I don't think one exists. Theres loads of examples of PHP xml things that take the raw xml data and turn it into nicer data structure.. but if you're after any sort of validation of an xml file against a schema.. well, I think you're probably screwed.
xsd is the xml version of dtd. they both declare the format of an xml document (which tags are allowed, which sibblings can a node have...)
the xml extension in php doesn't allow you to validate against dtd/xsd. (is one of the first lines in the php manual)
but with php5 and the dom extension you can do it
just load the DOMDocument and call schemaValidate($path_to_xsd_file)
the xml extension in php doesn't allow you to validate against dtd/xsd. (is one of the first lines in the php manual)
but with php5 and the dom extension you can do it
just load the DOMDocument and call schemaValidate($path_to_xsd_file)