Ann said:
>> I also wonder if
>> it is possible to parse an XML document against its XML
>> schema if it includes a DOCTYPE, which implies DTD. (This is a
question
>> - I meant ot try it at work last week and ran out of time.)
I said:
> It does require the internal subset to provide the entity
> declaration, and it requires a parser to process the internal
> subset, but I think it is OK. I'm fairly sure I tested
> examples of this using XSV (the W3C XML Schema validator).
>
> With Xerces, I think I did encounter a problem with being
> able to set the appropriate parser flags to get it to read
> the internal subset without getting upset about the absence
> of a DTD but, IIRC, that was a limitation of the sample apps
> that came with Xerces.
>
> I think there _are_ some issues around XML Schema validation
> and entity declarations - I'll check it out, but I _think_
> the use of the internal subset is OK.
I put an example of a DC-XML instance using an XML entity reference on
the DC Architecture wiki
http://dublincore.org/architecturewiki/DCXMLRevision_2fDCXMLInstances_2f
2006-06-01?action=AttachFile&do=get&target=ex9.xml
This validates OK using W3C's XSV XML Schema validation service
http://www.w3.org/2001/03/webdata/xsv?docAddrs=http%3A%2F%2Fdublincore.o
rg%2Farchitecturewiki%2FDCXMLRevision_2fDCXMLInstances_2f2006-06-01%3Fac
tion%3DAttachFile%26do%3Dget%26target%3Dex9.xml&style=xsl#
And also the results of the GRDDL XSLT transform
http://www.w3.org/2005/08/online_xslt/xslt?xslfile=http%3A%2F%2Fdublinco
re.org%2Farchitecturewiki%2FDCXMLRevision_2fDCXMLXSLT_2f2006_2d06_2d01%3
Faction%3DAttachFile%26do%3Dget%26target%3Ddcx2rdfxml.xsl&xmlfile=http%3
A%2F%2Fdublincore.org%2Farchitecturewiki%2FDCXMLRevision_2fDCXMLInstance
s_2f2006_2d06_2d01%3Faction%3DAttachFile%26do%3Dget%26target%3Dex9.xml&c
ontent-type=&submit=transform
(Sorry about the long URIs - you may have to re-join them!)
show that the entity reference has been correctly resolved (though I
don't think that transform process has done XML Schema validation
because it's using the free version of Saxon)
So... I think using the internal subset in ths way is OK (but I'm still
not 100% sure and I'll try to pursue it further with other tools!)
Cheers
Pete
|