Hi all,
   I am implementing assertions support in Xerces, as per the XML
Schema 1.1 spec. I have written quite a bit of code upto now for this.

As guided by the XML Schema 1.1 language, I have modified the file,
XSDComplexTypeTraverser.java of Xerces.

I have added a method,
private void traverseAssertions(Element assertElement,
            XSDocumentInfo schemaDoc, SchemaGrammar grammar)
            throws ComplexTypeRecoverableError

in XSDComplexTypeTraverser.java

I have done some testing. There are no compilation errors in the
Xerces code base after I have made the changes, and I am able to
export a JAR (something, like xercesImpl.jar) which I am able to test.

For testing, when I add, <xs:assert test="abc" /> as a child of,
<xs:complexType> in a sample document, and run the new Xerces code I
have written, the execution does go into the method,
traverseAssertions (which I have been able to accomplish).

At the beginning of this method, I have written a code like (copied
from Xerces itself),

Object[] attrValues = fAttrChecker.checkAttributes(assertElement,
                false, schemaDoc);
String test = (String) attrValues[XSAttributeChecker.ATTIDX_XPATH]; //XX

This will retrieve the attribute values of xs:assert element.

But I am getting null pointer exception at, line XX. The object
attrValues is coming as null. And the execution halts after this.

I have been debugging (the cause of null pointer exception) since past
few hours for this, but not been able to find the solution.

Can somebody please help, so I could proceed further with implementation.

I am really hoping I can complete assertions support (without, XPath
processing for now) quite soon.


On 7/23/08, Michael Glavassevich <[EMAIL PROTECTED]> wrote:
>
>
> Hi Mukul,
>
> No one has started working on assertions yet.
>
> For Google Summer of Code, Hiranya is currently working on type alternatives
> [1]. Both assertions and type alternatives require support for evaluation of
> XPath 2.0 expressions. However, type alternatives only requires a small
> subset of XPath 2.0. If there's any overlap with that work it would be
> small.
>
> The XPath 2.0 support in general is a fairly big open issue. Not clear what
> Xerces could use for that. I don't think we should try implementing the
> whole XPath 2.0 spec in this project. Anyway that still needs to be decided
> so would probably be a good idea to start on the other necessary things for
> assertion support like the traverser [2] and representation of assertions in
> XSModel [3].
>
> Thanks.
>
> [1]
> http://www.w3.org/TR/xmlschema11-1/#cTypeAlternative
> [2]
> https://svn.apache.org/repos/asf/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/
> [3]
> https://svn.apache.org/repos/asf/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: [EMAIL PROTECTED]
> E-mail: [EMAIL PROTECTED]


-- 
Regards,
Mukul Gandhi

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

Reply via email to