Vijay S. Bajwa wrote:
David Bertoni <dbertoni <at> apache.org> writes:

Vijay S. Bajwa wrote:
Trying to get DOMPrint to do schema validation with the following. Why
doesn't
it look at the schema? Why does it not know that xsi is a namespace defined
by
by the xmlns attribute? When I turn on the namespace option (-n) it just
hangs
there! Thanks for help! - Vijay
Without enabling namespace processing, you will get DTD validation, so you get validation errors.

If, when you enable namespace processing, the parser just "hangs there," perhaps there's something in your schema document that's the culprit. For example, there may be URLs in your schema document that the parser is trying to dereference.

Dave


The schema doc is below. It is clearly trying to reach these URI's because if I take these out, then it complains "xs" is not associated with any URI. What is the problem with the schema? Really appreciate help as I'm new to this whole thing. (not trying to get out on the cheap, have pored over lots of specs...):

Namespace declarations like:

xmlns:xs="http://www.w3.org/2001/XMLSchema";

are _never_ dereferenced by the parser.


<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2007 (http://www.altova.com) by Vijay S. Bajwa (Citigroup) --> <xs:schema xmlns:oas="http://citigroup.com/gts/oasys"; xmlns:xs="http://www.w3.org/2001/XMLSche
ma" elementFormDefault="unqualified" attributeFormDefault="unqualified">
    <xs:element name="gtsEquityBlock">
        <xs:annotation>
            <xs:documentation>Bundled eqty block plus all allocs (upto 10,000)
</xs:documentati
on>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element name="msgHdr" type="MsgHdrType"/>
                <xs:element name="eqtyBlock" type="EquityBlockType"/>
<xs:element name="eqtyAlloc" type="EquityAllocType" maxOccurs="10000"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:complexType name="MsgHdrType">
...
</xs:schema>

Since you've snipped out the rest of the schema document, it's hard to say what might be going on. For the most part, only xs:include and xs:import elements result in the parser dereferencing URLs.

You can find out what's going on by implementing the EntityResolver abstract base class, and installing an instance of your implementation into the parser. You could then set breakpoints in the resolveEntity() function, or write the values of the parameters to stderr, or something like that.

If the parser is not stalled trying to load URLs, then there must be some other reason why it is unable to load your schema document. In that case, you'll need to use the debugger to figure out what's going on.

Dave

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

Reply via email to