Re: Question on validation

2007-03-02 Thread Chris

Radu,

thank you for the response. I agree with Johannes, that it would be an 
useful feature.


Best regards,

Chris

Johannes Echterhoff schrieb:
Too bad because that would have been a nice feature of xmlbeans. Well, 
I do not know exactly how xmlbeans handles substitution groups 
internally, but it would certainly be nice if xmlbeans would - upon 
receiving an unknown substitution element - search for the missing 
class file (contained in schema2.jar) via the ClassLoader and could 
then recognize that it is a valid substitution element.


Regards,
Johannes


Radu Preotiuc-Pietro schrieb:

No, unfortunately, for substitution groups in particular, you have to
recompile both schemas into one jar. If you did not use substitution
groups, then it would be possible to do what you say.

Radu
-Original Message-
From: Chris [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 27, 
2007 2:34 AM

To: user@xmlbeans.apache.org
Subject: Question on validation

Hi,

I have a question on validation of xml documents:

Let's assume I have compiled a schema 'schema1.xsd' containing some
substitution groups into 'schema1.jar'. Later I have compiled another
schema 'schema2.xsd', defining some new elements of the substitution
groups in schema1, into 'schema2.jar'. If I now want to validate a
document 'schema1doc.xml', which contains substitution group elements
defined in schema2.xsd, the validation fails.

If I import schema2.xsd in schema1.xsd and then compile this into only
one jar, the validation works without an error. Do I always have to
recompile schemas, if there are new substitution groups elements defined
in other new schemata? Is there any possibility to let XmlBeans also use
new generated jars for validation?

Thanks,

Chris


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

___
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

-
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]





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



RE: xmlbeans-2.2.0 and error running XQueryXPath sample

2007-03-02 Thread Cezar Andrei
XMLBeans has just a few tests in the checkin tests that are using saxon, but 
they were working when I upgraded to saxonb8-8j and they still seem to be 
working with the current sources in SVN.

Cezar

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 02, 2007 6:40 AM
 To: user@xmlbeans.apache.org
 Subject: RE: xmlbeans-2.2.0 and error running XQueryXPath sample
 
 
 Hi Cezar,
 
 I've defined the classpath as follows:
 
 target name=run depends=init,build
 echo message=== running
 XQueryXPath/
 java
 classname=org.apache.xmlbeans.samples.xquery.XQueryXPath
 fork=true
 arg line=xml/employees.xml/
 classpath
   pathelement
 path=${LIB_PATH}/xbean.jar;${LIB_PATH}/xbean_xpath.jar;${LIB_PATH}/jsr173
 _1.0_api.jar;${LIB_PATH}/saxon8.jar;;build/classes/
 /classpath
 /java
 /target
 
 but I got:
 
   [java] java.lang.IllegalArgumentException: When a DOMSource is used,
 saxon8-dom.jar must be on the classpath
 
 So I've added also:   ${LIB_PATH}/saxon8-dom.jar
 
 Now:
 
 run:
  [echo] == running XQueryXPath
  [java] Running ExecQuery.selectEmpsByStateCursor
 
  [java] java.lang.NoSuchMethodError:
 net.sf.saxon.query.DynamicQueryContext.getContextNode()Lnet/sf/saxon/om/No
 deInfo;
  [java] at
 org.apache.xmlbeans.impl.xquery.saxon.XBeansXQuery.execQuery(XBeansXQuery.
 java:76)
  [java] at
 org.apache.xmlbeans.impl.store.Query$SaxonQueryImpl$SaxonQueryEngine.curso
 rExecute(Query.java:345)
  [java] at
 org.apache.xmlbeans.impl.store.Query$SaxonQueryImpl.cursorExecute(Query.ja
 va:243)
  [java] at
 org.apache.xmlbeans.impl.store.Query.cursorExecQuery(Query.java:48)
  [java] at
 org.apache.xmlbeans.impl.store.Cursor._execQuery(Cursor.java:1336)
  [java] at
 org.apache.xmlbeans.impl.store.Cursor._execQuery(Cursor.java:1331)
  [java] at
 org.apache.xmlbeans.impl.store.Cursor.execQuery(Cursor.java:3839)
  [java] at
 org.apache.xmlbeans.samples.xquery.ExecQuery.updateWorkPhone(ExecQuery.jav
 a:74)
  [java] at
 org.apache.xmlbeans.samples.xquery.XQueryXPath.executeQueries(XQueryXPath.
 java:75)
  [java] at
 org.apache.xmlbeans.samples.xquery.XQueryXPath.main(XQueryXPath.java:54)
  [java] Exception in thread main
  [java] Java Result: 1
 
 But the saxon8.jar (taken from
 http://easynews.dl.sourceforge.net/sourceforge/saxon/saxonb8-8j.zip)
 contains this class, maybe it is not compatible with xmlbeans-2.2.0.
 
 Regards
 Patrizio
 
 
 -Original Message-
 From: Cezar Andrei [mailto:[EMAIL PROTECTED]
 Sent: giovedì, 1. marzo 2007 21:27
 To: user@xmlbeans.apache.org
 Subject: RE: xmlbeans-2.2.0 and error running XQueryXPath sample
 
 
 Patrizio,
 
 Make sure you have the following jars on the classpath, not only in
 build/lib:
   xbean.jar, xbean_xpath.jar, jsr173_1.0_api.jar and saxon.jar.
 The latest we tested with is saxonb8-8j from
 http://easynews.dl.sourceforge.net/sourceforge/saxon/saxonb8-8j.zip .
 
 Cezar
 
 
 
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Thursday, March 01, 2007 5:01 AM
 To: user@xmlbeans.apache.org
 Subject: xmlbeans-2.2.0 and error running XQueryXPath sample
 
 Hi all,
 
 I'm trying to run the XQueryXPath sample bundled with xmlbeans-2.2.0.
 
 I've compiled the sample and updated the xmlbeans-
 2.2.0\samples\XQueryXPath\build\lib folder with the below entries:
 
 12.06.2006  11:45    23'630 jsr173_1.0_api.jar
 12.06.2006  11:45    60'047 resolver.jar
 28.02.2007  16:43    40'109 schemas.jar
 12.06.2006  11:45 2'664'574 xbean.jar
 12.06.2006  11:45 5'578 xbean_xpath.jar
 12.06.2006  11:45   429'483 xmlpublic.jar
 12.02.2007  11:30 3'728'517 saxon8.jar
 I took the first 6 jars from xmlbeans-2.2.0\lib and the last (saxon8.jar)
 from saxonsa8-9j distribution.
 I've added the last one because I've found that it is mandatory in order
 to find the xquery engine.
 
 But when I try to run the sample I got the No query engine found error:
 
 C:\software\xmlbeans-2.2.0\samples\XQueryXPathant run
 Buildfile: build.xml
 
 init:
  [echo] xmlbeans.home: C:\software\xmlbeans-2.2.0
  [echo] xmlbeans.lib: C:\software\xmlbeans-2.2.0/lib
 
 schemas.check:
 
 schemas.jar:
 
 XQueryXPath.classes:
 
 build:
 
 run:
  [echo] == running XQueryXPath
  [java] Running ExecQuery.selectEmpsByStateCursor
 
  [java] java.lang.RuntimeException: No query engine found
  [java] at
 org.apache.xmlbeans.impl.store.Query.getCompiledQuery(Query.java:120)
  [java] at
 org.apache.xmlbeans.impl.store.Query.getCompiledQuery(Query.java:53)
  [java] at
 org.apache.xmlbeans.impl.store.Query.cursorExecQuery(Query.java:48)
  [java] at
 

RE: Set() of a nil element leaves element in invalid state

2007-03-02 Thread Cezar Andrei
Joseph,

 

Do I understand correctly that when running with asserts disabled it
works fine?

Please file a bug in JIRA to track of it, and if you can include a small
repro would be even better.

 

Cezar

 

 



From: Joseph Campolongo [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 28, 2007 12:45 PM
To: user@xmlbeans.apache.org
Subject: Set() of a nil element leaves element in invalid state

 

I have assertions enabled for v.2.2.0 of XmlBeans under JDK 1.5_10.
While trying to validate my bean, I get an AssertionError at the
following location:

 

   at
org.apache.xmlbeans.impl.values.XmlObjectBase.build_text(XmlObjectBase.j
ava:837)

   at
org.apache.xmlbeans.impl.store.Xobj.ensureOccupancy(Xobj.java:1694)

   at org.apache.xmlbeans.impl.store.Cur.next(Cur.java:1444)

   at
org.apache.xmlbeans.impl.store.Validate.process(Validate.java:74)

   at
org.apache.xmlbeans.impl.store.Validate.init(Validate.java:39)

   at org.apache.xmlbeans.impl.store.Xobj.validate(Xobj.java:1860)

   at
org.apache.xmlbeans.impl.values.XmlObjectBase.validate(XmlObjectBase.jav
a:343)

 

The line of code is

 

assert((_flags  FLAG_VALUE_DATED) == 0);

 

In other words, after a set() call, the value is in an invalid state.

 

What is happening is that I'm first setting various values in the bean
and then validating it.  It appears that, if I set a value that had
previously been 'nil', then the above flag gets set on the element:

 

   XmlBase64BinaryImpl(XmlObjectBase).invalidate_nilvalue() line:
792   

   Xobj$ElementXobj(Xobj).invalidateNil() line: 1385  

   Xobj$AttrXobj(Xobj).invalidateSpecialAttr(Xobj) line: 915 

   Cur.moveNode(Xobj, Cur) line: 1922 

   Cur.moveNode(Cur) line: 1841  

   Xobj$ElementXobj(Xobj).removeAttr(QName) line: 520 

   Xobj$ElementXobj(Xobj).invalidate_nil() line: 2038 

   XmlBase64BinaryImpl(XmlObjectBase).set_commit() line: 1313

   XmlBase64BinaryImpl(XmlObjectBase).set(byte[]) line: 1617 

   XmlBase64BinaryImpl(XmlObjectBase).setByteArrayValue(byte[])
line: 1553

   SymbolImpl.setSymbolData(byte[]) line: 466  



The set occurs, but, after the set, the 'nil' attribute is cleared,
which calls the following code:

 

public final void invalidate_nilvalue()

{

assert((_flags  FLAG_STORE) != 0);

_flags |= FLAG_VALUE_DATED | FLAG_NIL_DATED;

}

 

This code very clearly sets the FLAG_VALUE_DATA flag, which leaves the
entire element in an invalid state.

 

Is this how everything should work?  Is the assert incorrect?  Is there
something I should be doing to the bean after I set the values?  How
should I approach dealing with this?  I'm running into this quite a bit,
so I would appreciate any help.

 

Thank you,

 

jvc

___
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.


RE: How to add DOCTYPE to my XmlObject

2007-03-02 Thread Christopher . Mathrusse



I found it. 
XmlDocumentProperties props = 
confirmDoc.documentProperties();props.setVersion(orderRequest.documentProperties().getVersion());props.setEncoding(orderRequest.documentProperties().getEncoding());props.setDoctypeSystemId(DOCTYPE_SYSTEM_ID);props.setDoctypeName(DOCTYPE_NAME);


From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] Sent: Friday, March 02, 
2007 10:18 AMTo: user@xmlbeans.apache.orgSubject: How to 
add DOCTYPE to my XmlObject



I'm 
using XmlBeans to process my inbound documents. The documents are based upon a 
dtd. I've created a schema that represents the dtd so I could generate my 
XmlBeans. All processing works successfully but the problem I am having pertains 
to the DOCTYPE.The request documents we receive from our Trading Partner 
have the DOCTYPE element specified. This is needed for proper processing. It 
looks as follows:
!DOCTYPE 
Pip3A4PurchaseOrderConfirmation SYSTEM 
"3A4_MS_V02_02_PurchaseOrderRequest.dtd"
My 
challenge now is how can I place the following into my confirmation documents 
that I build and send back to my Trading Partner?
!DOCTYPE Pip3A4PurchaseOrderConfirmation SYSTEM 
"3A4_MS_V02_02_PurchaseOrderConfirmation.dtd"
Thanks for the 
help

Chris Mathrusse
[EMAIL PROTECTED]
(925) 236-5553
- 
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]