Jim Barnett | 9 May 2013 16:12

debugging tools?

Are there tools that will help me debug a complex assertion?  I’ve tried using trace, but it doesn’t seem to print out messages when it’s inside an ‘every’ or a ‘some’.   I’ve attached the example I’m trying to debug.  The assertion in line 26 of the schema should reject the <transition> in line 7 of sample.scxml, but it doesn’t (so validation succeeds).  I can’t tell if there’s a logical error in my schema, or if I’m not using some element correctly.  Can someone give me some hints on how to debug the assertion’s application? 

 

Thanks in advance,

Jim Barnett

Attachment (sample.scxml): application/octet-stream, 337 bytes
Attachment (test_schema.xsd): text/xml, 3192 bytes

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe <at> xerces.apache.org
For additional commands, e-mail: j-users-help <at> xerces.apache.org
Roberto Marabini | 22 Apr 2013 02:22
Picon

validating a XML file using XSD 1.1 with Xerces-J

Hi,

    I am trying to write a XSD 1.1 schema that uses  XSD 1.1
assertions. I am able to repeat the examples described in the URL:
http://mukulgandhi.blogspot.com.es/2009/11/xsd-11-some-xsd-11-samples-running-with.html
so I guess my xerces-j installation is OK.

   When I tried to include an assert in my schema (I reproduce part of
it in the email and attach the full file) I got the error message:

[Error] kk.emx:33:14: cvc-assertion.3.13.4.1: Assertion evaluation
('defocusU ge defocusV') for element 'particle' with type '#anonymous'
did not succeed.

but defocusU is indeed greater than defocusV

Note that the commented lines

<!-- <xsd:assert test="t34 le 3" />-->
<!-- <xsd:assert test=" <at> index le 3" />-->

work properly when uncommented

but

        <xsd:assert test="defocusU ge defocusV" />

does not. I guess the problem is that defocusU and defocusV are complextypes

any help will be welcomed

    thanks

               Roberto
=================

Schema

<?xml version="1.1" encoding="UTF-8"?>
<xsd:schema elementFormDefault="qualified"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">

...............
...............
..............

<xsd:element name="EMX">
    <xsd:complexType>
      <xsd:sequence>
	
      <xsd:element name="micrograph" type="microType"
maxOccurs="unbounded" minOccurs="0"/>

      <xsd:element name="particle" maxOccurs="unbounded" minOccurs="0">
	    <xsd:complexType>
	      <xsd:all>
	        <xsd:element name="defocusU" type="defocusType"
maxOccurs="1" minOccurs="0"/>
	        <xsd:element name="defocusV" type="defocusType" maxOccurs="1"
minOccurs="0"/>
	        <xsd:element name="defocusUAngle" type="angleType"
maxOccurs="1" minOccurs="0"/>

	        <xsd:element name="micrograph" maxOccurs="1" minOccurs="0">
	          <xsd:complexType>
		         <xsd:simpleContent>
		             <xsd:extension base="xsd:string">
		                 <xsd:attribute name="fileName" type="xsd:string"
use="required"/>
		                 <xsd:attribute name="index" type="xsd:integer"/>
		             </xsd:extension>
		         </xsd:simpleContent>
	          </xsd:complexType>
	        </xsd:element>
	
            <xsd:element name="activeFlag"
type="xsd:nonNegativeInteger" maxOccurs="1" minOccurs="0"/>
	        <xsd:element name="boxSize" maxOccurs="1" minOccurs="0">
	          <xsd:complexType>
		        <xsd:all>
		          <xsd:element name="X" type="boxSizeType" maxOccurs="1"
minOccurs="1"/>
		          <xsd:element name="Y" type="boxSizeType" maxOccurs="1"
minOccurs="1"/>
		        </xsd:all>
	          </xsd:complexType>
	        </xsd:element>

	        <xsd:element name="centerCoord" maxOccurs="1" minOccurs="0">
	          <xsd:complexType>
		        <xsd:all>
		          <xsd:element name="X" type="coordType" maxOccurs="1" minOccurs="1"/>
		          <xsd:element name="Y" type="coordType" maxOccurs="1" minOccurs="1"/>
		        </xsd:all>
	          </xsd:complexType>
	        </xsd:element>
	
            <xsd:element name="fom" type="decimalBTzeroANDone"
maxOccurs="1" minOccurs="0"/>
	        <xsd:element name="pixelSpacing" maxOccurs="1" minOccurs="0">
	          <xsd:complexType>
		        <xsd:all>
		          <xsd:element name="X" type="samplingType" maxOccurs="1"
minOccurs="1"/>
		          <xsd:element name="Y" type="samplingType" maxOccurs="1"
minOccurs="1"/>
		        </xsd:all>
	          </xsd:complexType>
	        </xsd:element>

	        <xsd:element name="transformationMatrix" maxOccurs="1" minOccurs="0">
	          <xsd:complexType>
		        <xsd:all>
		          <xsd:element name="t11" type="xsd:double" maxOccurs="1"
minOccurs="0"/>
		          <xsd:element name="t12" type="xsd:double" maxOccurs="1"
minOccurs="0"/>
		          <xsd:element name="t13" type="xsd:double" maxOccurs="1"
minOccurs="0"/>
		          <xsd:element name="t14" type="transformationType"
maxOccurs="1" minOccurs="0"/>
		          <xsd:element name="t21" type="xsd:double" maxOccurs="1"
minOccurs="0"/>
		          <xsd:element name="t22" type="xsd:double" maxOccurs="1"
minOccurs="0"/>
		          <xsd:element name="t23" type="xsd:double" maxOccurs="1"
minOccurs="0"/>
		          <xsd:element name="t24" type="transformationType"
maxOccurs="1" minOccurs="0"/>
		          <xsd:element name="t31" type="xsd:double" maxOccurs="1"
minOccurs="0"/>
		          <xsd:element name="t32" type="xsd:double" maxOccurs="1"
minOccurs="0"/>
		          <xsd:element name="t33" type="xsd:double" maxOccurs="1"
minOccurs="0"/>
		          <xsd:element name="t34" type="transformationType"
maxOccurs="1" minOccurs="0"/>
		        </xsd:all>
              <!-- <xsd:assert test="t34 le 3" />-->
	          </xsd:complexType>
	        </xsd:element>
	
	      </xsd:all>
	      <xsd:attribute name="fileName" type="xsd:string" use="required"/>
	      <xsd:attribute name="index" type="xsd:integer"/>
        <!-- <xsd:assert test=" <at> index le 3" />-->
        <xsd:assert test="defocusU ge defocusV" />
	    </xsd:complexType>
    </xsd:element>
	
    </xsd:sequence>
    <xsd:attribute name="version" type="numVersion" use="required"/>
  </xsd:complexType>
</xsd:element>

</xsd:schema>
Attachment (emx.xsd): application/octet-stream, 9 KiB
Attachment (kk.emx): application/octet-stream, 2040 bytes

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe <at> xerces.apache.org
For additional commands, e-mail: j-users-help <at> xerces.apache.org
Jim Barnett | 18 Apr 2013 17:30

problems using tokenize()

I’m having trouble getting tokenize() to behave the way I expect it to.  As before, I have an element with an attribute <at> target with type idrefs.  I want to split the value into the individual idrefs (I will run more complicated tests on them, but for the moment I’m just trying to get access to them).  In the attached document and schema, I have two assertions.  The first, using matches() succeeds, but the second, using tokenize(), fails:

 

<xsd:assert test="matches(string( <at> target), '\S+(\s+\S+)+')" xpathDefaultNamespace="##targetNamespace"/>

<xsd:assert test="boolean(tokenize(string( <at> target), '\s+'))"  xpathDefaultNamespace="##targetNamespace"/>

 

What am I doing wrong? 

 

Thanks,

Jim

Attachment (sample.scxml): application/octet-stream, 337 bytes
Attachment (test_schema.xsd): text/xml, 2907 bytes

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe <at> xerces.apache.org
For additional commands, e-mail: j-users-help <at> xerces.apache.org
Jim Barnett | 16 Apr 2013 20:42

regular expression matching in <assert>

Are matches() and tokenize() supported inside <assert> when doing schema validation?  I am applying an assertion to an element with a ‘target’ attribute whose value is “s1 s2”, yet the following assertion is failing:

 

<xsd:assert test="if (matches( <at> target, '.*')) then true()  else false()"  xpathDefaultNamespace="##targetNamespace"/>

 

Any guidance would be appreciated.

 

Thanks,

Jim

Ronny | 5 Apr 2013 16:11
Picon

Validate XML by XSD failes with jDOM and Xerces 2.10.0

Hi list,

I've got a problem validating a xml by a xsd.

A short preview about the xsd:

<complexType name="MyType2">
 <attribute name="MyAttribute" type="string" use="required" />
</complexType>

<complexType name="MyType1 ... />

<element name="MyRoot">
 <complexType>
  <choice>
   <element name="MyType1" ... />
   <element name="MyType2" type="MyType2" minOccurs="1" maxOccurs="1" />
  </choice>
 </complexType>
</element>

Ok, my XML file looks like this:

<MyRoot xmlns="..." ...>
 <MyType2 MyAttribute="something">
  ...
 </MyType2>
</MyRoot>

Now I try to validate this with jDOM by using xerces. Then I got the
following error:
 - Error on line 6: cvc-complex-type.3.2.2: Attribute "MyAttribute" must
not occur in element "MyType2".

I validated the same xml with the same xsd with oXygen (which also uses
xerces) and with some online validators. All told me that the xml is valid.

So my question is, why does the JAVA implementation gives tells me that
the xml is not valid.

I'm grateful for some hints.

Thanks!

Best regards,
Ronny
Hector Barragan | 1 Apr 2013 21:03
Favicon

fPreviousChunk == NULL exception on parsing a 2 GB XML file

Hi there

In the below version, has the 2 GB file size bug been fixed?



Xerces2 Java Parser 2.11.0 Release







The sax parser wont read/handle a XML file more than 2 GB, populating the below exception

java.lang.RuntimeException: Internal Error: fPreviousChunk == NULL
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1094)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:223)

Currently we have this version

Sax version is 2009 xercesImpl-2.2.1.jar 2009 xerces.jar

Thanks in advance



_______________________________________________________________________________
Hector Barragan | Contractor | Derivatives Technology
801 S. Canal Chicago IL, 60607 USA||Cell 1 (312) 285 4793 hb58 <at> ntrs.com
Please visit northerntrust.com

Miron, Radu | 1 Apr 2013 11:50
Picon
Favicon
Gravatar

Problem with apache-xerces.2.9.1.jar file

Hello,

 

I would want to subscribe in order to notify you that you have an issue with your latest apache-xerces.2.9.1.jar file. The JAR file cannot be opened and introduces problems during our build process.

 

Repository Path:

/apache-xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar

Uploaded by:

deployment

Size:

168 Bytes

Uploaded Date:

Mon Apr 01 2013 09:50:10 GMT+0300 (GTB Daylight Time)

Last Modified:

Mon Apr 01 2013 09:50:10 GMT+0300 (GTB Daylight Time)

 

 

 

 

SHA1

d3b963c1d3e2ff326632c5f5a02fdb44cfaaea77

MD5

f48a70649b86c40ebb4c86ff0ce8a070

 

The file you have now is 168 bytes, but the file from yesterday has 1,229,125 bytes. This last file is the correct one.

Please notify me of a fix when fixed.

 

Thanks,

Radu

 

 

Chris Simmons | 14 Mar 2013 11:37
Favicon

Schema Grammar validity question.

I've got three grammars with a potentially dubious substitution group chain.

In a.xsd we have an attribute group declaring ##other.

In b.xsd we have an extension of a type from c.xsd declaring an ID 
attribute.

In c.xsd we have the base type, which declares a single attribute and 
##other.

Now the question is, is this valid according to point 1.3 of this section?

http://www.w3.org/TR/xmlschema-1/#cos-ct-extends

The reason I ask is that I'm getting conflicting answers.  Xerces says 
its valid, but XSD 
(http://www.eclipse.org/modeling/mdt/?project=xsd#xsd) claims that it 
isn't valid.

So who's right and why?

Regards,

Chris Simmons.

Attachment (a.xsd): application/xml, 697 bytes
Attachment (c.xsd): application/xml, 599 bytes
Attachment (b.xsd): application/xml, 574 bytes

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe <at> xerces.apache.org
For additional commands, e-mail: j-users-help <at> xerces.apache.org
Jorge Williams | 4 Mar 2013 22:30

Trouble compiling XSD 1.1 branch

Hey guys,

I'm on the latest xml-schema-1.1-dev branch in SVN. Trying to compile with 

./build.sh clean jars-schema11

I'm getting all sorts of errors:

compile-schema11:
     [copy] Copying 23 files to /Users/jorgew/projects/xercesj/build/classes
   [xjavac] Compiling 776 source files to /Users/jorgew/projects/xercesj/build/classes
   [xjavac]
/Users/jorgew/projects/xercesj/build/src/org/apache/xerces/impl/xs/alternative/Test.java:38:
package org.eclipse.wst.xml.xpath2.processor does not exist
   [xjavac] import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
   [xjavac]                                            ^
   [xjavac]
/Users/jorgew/projects/xercesj/build/src/org/apache/xerces/impl/xs/alternative/Test.java:39:
package org.eclipse.wst.xml.xpath2.processor.ast does not exist
   [xjavac] import org.eclipse.wst.xml.xpath2.processor.ast.XPath;
   [xjavac]                                                ^
   [xjavac]
/Users/jorgew/projects/xercesj/build/src/org/apache/xerces/impl/xs/AbstractPsychoPathXPath2Impl.java:33:
package org.eclipse.wst.xml.xpath2.processor does not exist
   [xjavac] import org.eclipse.wst.xml.xpath2.processor.DefaultDynamicContext;
   [xjavac]                                            ^
   [xjavac]
/Users/jorgew/projects/xercesj/build/src/org/apache/xerces/impl/xs/AbstractPsychoPathXPath2Impl.java:34:
package org.eclipse.wst.xml.xpath2.processor does not exist
   [xjavac] import org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator;
   [xjavac]                                            ^
   [xjavac]
/Users/jorgew/projects/xercesj/build/src/org/apache/xerces/impl/xs/AbstractPsychoPathXPath2Impl.java:35:
package org.eclipse.wst.xml.xpath2.processor does not exist
   [xjavac] import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
   [xjavac]                                            ^

What am I missing?

-jOrGe W.
Philippe.Favrais | 21 Feb 2013 18:03
Favicon

support for xpointer

Hello all

I am a user of Xerces-J and plan to use the Xpointer feature which from the specification i read seems to be very powerfull.
However after few tries, i realized that not all is yet completly supported.

What is the strategy of Xerces in regard to this Xpointer feature ?
Will it be implemented or is there other solutions ?

Thank you
Best regards
Philippe Favrais
karthikeyan.sd | 28 Jan 2013 09:32
Favicon

Info regarding XML Serializer property setting


Dear users,

We recently moved to IBM  WAS 6 to WAS 7.We have a code printing the xml
file which uses the serializer jar provided by IBM.

Problem noticed in WAS7 is that Carriage Return is converted to &#13 within
CDATA section of an element.

For ex,

WAS6

<MsgTyp><![CDATA[other
Document]]></MsgTyp>

WAS7

<MsgTyp><![CDATA[other]]>&#13;<![CDATA[
Document]]></MsgTyp>

Can anyone please assist us to get this fixed.

Thanks,
karthik

This e-Mail may contain proprietary and confidential information and is sent for the intended
recipient(s) only.  If by an addressing or transmission error this mail has been misdirected to you, you
are requested to delete this mail immediately. You are also hereby notified that any use, any form of
reproduction, dissemination, copying, disclosure, modification, distribution and/or publication
of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited.

Visit us at http://www.polarisFT.com

Gmane