Oops!

   xsi:schemaLocation="http://www.w3.org/2000/svg svg.xsd

does contain the schema location hint and target namespace. I should have been paying more attention. :)

-Prashant

Prashant wrote:


Hello all,

<snip>

I am loading documents like this:

DocumentBuilderFactory factory = new
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl();
factory.setFeature("http://apache.org/xml/features/validation/schema";,
true);
factory.setFeature("http://xml.org/sax/features/validation";, true); factory.setFeature("http://xml.org/sax/features/namespaces";, true);
factory.setNamespaceAware(true);

DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(source);

Even trying to validate a little document like this:

<?xml version="1.0" encoding="UTF-8"?>
<svg:svg height="10cm" width="11cm" viewBox="0 0 1100 1000"
xmlns:svg="http://www.w3.org/2000/svg";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xsi:schemaLocation="http://www.w3.org/2000/svg svg.xsd ">

    <svg:rect x="1" y="1" width="1098" height="998" fill="none"
stroke="blue" stroke-width="2" />

</svg:svg>
Should't the xsi:schemaLocation contain pairs of values: The first member of each pair is the namespace for which the second member is the hint describing where to find to an appropriate schema document.

At the risk of hijacking this thread, I would like to know how the parser could locate the schema definition using the above sited piece of code that did not supply its own external schema location ?

I would have expected the parser to fail with "Cannot find the declaration of element 'svg'".

-Prashant

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to