Re: Xerces-J 2.* On JDK 9

2017-12-06 Thread Jeff Greif
You put the xerces jars in the "endorsed overrides" directory. https://docs.oracle.com/javase/8/docs/technotes/guides/standards/ On Tue, Dec 5, 2017 at 1:18 PM, Mark Raynsford < list+org.apache.xer...@io7m.com> wrote: > Hello. > > Is it possible to use Xerces in a (modular) JDK 9 project? > > I'

Re: Cannot create a Schema object for an XSD file with the targetNamespace attribute set on an element

2015-08-07 Thread Jeff Greif
I am mainly familiar with XML Schema 1.0, so it's possible my assertions below have been supplanted in 1.1. The purpose of a schema is to declare the contents of a single namespace, the target namespace, which is declared on the 'schema' element. Constructs of another namespace cannot be declared

Re: Delay during parsing

2014-08-04 Thread Jeff Greif
One possibility is that the .dtd URI referred to in the DOCTYPE is being loaded from the web. You can make a local copy and register it in an XML catalog or otherwise provide it to a custom LSResourceResolver in the DOMConfiguration attached to the LSParser. (Even if not validating against the DT

Re: Lazy DOM with regards to memory usage

2012-09-27 Thread Jeff Greif
Would it be sufficient to specify your DOM's Document implementation class to the JAXP DocumentBuilderFactory using the factory's setAttribute method? See the first example here: http://xerces.apache.org/xerces2-j/properties.html On 9/27/2012 1:25 PM, Dominik Rauch wrote: > Hello Xerces-List!

Representation of complex types derived by extension

2010-09-18 Thread Jeff Greif
When using the Xerces 2.8.1 XML Schema API, the derived type from this schema: http://www.w3.org/2001/XMLSchema"; targetNamespace="urn:webalo:try-extension" xmlns:tns="urn:webalo:try-extension">

Re: Webapp classpath confusion

2009-10-29 Thread Jeff Greif
try putting the Xerces 2.9.1 jars in $TOMCAT_HOME/common/lib or .../endorsed (depends on version of Tomcat). Jeff Benson Margulies wrote: My immediate problem is that I don't have an adequate characterization of my problem. If I run a test in a plain old java object with no explicit Xerces

Re: Webapp classpath confusion

2009-10-29 Thread Jeff Greif
You probably need to put Xerces into the Tomcat lib directory, or some other directory that serves as an "endorsed" override to the JDK's version (or some other JAXP that gets loaded before your webapp). In different appservers, there are different conventions for whether the container's class

Re: Composite schema issue

2009-07-01 Thread Jeff Greif
You can put any URI you want into the location attribute on import or include, and resolve it from schemas held in strings or relational databases or resources in a jar file or anything else, if you provide an EntityResolver to the parser. See DocumentBuilder.setEntityResolver(). You can also use

Re: Java representation of a complex schema type

2009-06-28 Thread Jeff Greif
Sorry to reply to my own post, but I forgot to mention that from the XSElementDeclaration you can get its enclosing complex type definition (using getEnclosingCTDefinition()) and from there work back to the particle for the element declaration. Jeff On Sun, Jun 28, 2009 at 6:36 PM, Jeff Greif

Re: Java representation of a complex schema type

2009-06-28 Thread Jeff Greif
>From the ElementPSVI on the root of the document, you can get the XSModel using getSchemaInformation. From there you can work your way through the complex type definition to the XSParticle whose term is the XSElementDeclaration in question, and get access to the max/minOccurs info. Jeff On Sun,

Re: parsing an xml document chunk by chunk

2009-04-08 Thread Jeff Greif
I think you have two problems here, a network handling problem and an XML parsing problem. The options you describe are by no means the only ones. In particular, you don't need a thread per request; however, you do need an XML parser exclusively handling each single document if you are using Xerc

Re: XML Schema default attributes

2008-05-15 Thread Jeff Greif
t version > (2.9.1) but don't recall that there was any issue with 2.8.1. Perhaps > there's something you're doing that you haven't mentioned here. A snippet of > your code might help. > > Thanks. > > Michael Glavassevich > XML Parser Development > IBM To

Re: XML Schema default attributes

2008-05-14 Thread Jeff Greif
e problem before the parsed XML is passed to the deserializer. Jeff Nathan Beyer wrote: Check out the PSVI API [1] - Post-Schema-Validation-Infoset [1] http://xerces.apache.org/xerces2-j/faq-xs.html On Tue, May 13, 2008 at 2:56 PM, Jeff Greif <[EMAIL PROTECTED] <mailto:[EMAIL PRO

XML Schema default attributes

2008-05-13 Thread Jeff Greif
How can the Xerces parser be directed to insert attributes, specified in XML Schema to have default values, into a DOM during parsing when the attributes are not present in the input source? Presumably schema-validation must be turned on, but apparently some other setting is needed. The default a

Re: Avoiding DOM Reparse

2007-12-11 Thread Jeff Greif
If you have a pretty good idea of the set of schemas that will be needed before reading the instance documents, you could preparse those schemas into a GrammarPool associated with the instance document parser. That way, most or all of the documents could be validated as they are read (the first ti

Re: XML Schema API determining to what XSComplexTypeDefinition an XSElementDeclaration belongs to

2007-11-22 Thread Jeff Greif
If I recall correctly, the model group for B should contain a sequence with the two elements a,b. That is, the complex type definition for B already has the process of extending A built into its content model. Jeff On 11/22/07, Srdjan Djuricic <[EMAIL PROTECTED]> wrote: > > Hello, > > I have a si

Re: Help navigating schema

2007-11-20 Thread Jeff Greif
The components that are accessible from model.getComponents() are those at top-level in the schema, the global elements and named type definitions (children of the xs:schema element). You asked only for the complex type definitions (the named ones), not also for the global elements. If you as

Re: Caching XSModel instead of SchemaGrammar?

2007-10-18 Thread Jeff Greif
Thanks much, Michael. XSGrammar should do the trick. Jeff On 10/18/07, Michael Glavassevich <[EMAIL PROTECTED]> wrote: > Hi Jeff, > > Jeff Greif <[EMAIL PROTECTED]> wrote on 10/18/2007 01:01:25 PM: > > > Xerces-J has the very useful feature of GrammarPools, caching

Caching XSModel instead of SchemaGrammar?

2007-10-18 Thread Jeff Greif
Xerces-J has the very useful feature of GrammarPools, caching SchemaGrammars (and other Grammars) for use in parsing. However, in recent versions, SchemaGrammar has been marked as an internal class subject to removal. The DOM Level 3 Load and Save XSModel class seems to be in some ways simila

Re: xsi:schemaLocation in XML files

2007-10-08 Thread Jeff Greif
2.9.0 today to > test any changes! > > Jeff, can you bear with me here I think I understand you... > > Jeff Greif wrote: > > Maybe an example will be clearer. > > > > The instance document is, relative to some subtree of the file system, in > > > &g

Re: xsi:schemaLocation in XML files

2007-10-08 Thread Jeff Greif
ccessfully, but only because the paths work whether the reference is from the instance doc or a schema doc. Jeff On 10/8/07, Chris Bray <[EMAIL PROTECTED]> wrote: > Jeff. > > My comments inline. > > Chris > > Jeff Greif wrote: > > When a relative URL is u

Re: xsi:schemaLocation in XML files

2007-10-08 Thread Jeff Greif
When a relative URL is used for the location of an imported schema, it is supposed to be relative to the URL of the importing document. So if your instance document directly references the namespaces of one or more schemas for validation, whose URLs are interpreted relative to the location of the

Re: importNode()/adoptNode() and getElementById()

2007-01-30 Thread Jeff Greif
Doesn't this discussion hinge on what confers IDness? Among the various possibilities are these: 1. You're copying nodes from a namespace-aware document conforming to a schema which defines certain attributes as having type ID, into a document governed by the same schema or one which imports th

Re: R: Using honour-all-schemaLocations feature in Xerces-j - 2.8.1

2006-12-07 Thread Jeff Greif
The schema spec requires that all parts of a schema from the target namespace of a given schema be present in that schema document or d. A location is required in the element because there may be more than one. The normal externalSchemaLocation mechanism would not allow multiple items for the s

Re: XML Schema + Namespace Issues

2006-10-20 Thread Jeff Greif
Add elementFormDefault="qualified" to the xsd:schema element in schema a to get the behavior you were expecting. This menas that elements declared within a complexType definition are in the target namespace of the schema. This attribute has the default value "unqualified", meaning such elem

Re: validating xml and retrieval of xsd

2006-07-26 Thread Jeff Greif
You've told the validator (in the xmlns=... atttribute) that the element personnel is in namespace n1, and you've told it where to find the schema for namespace n2 (in the schemaLocation attribute). Since you haven't told it where to find the schema for n1, there is no declaration available for

Re: More on schema navigation

2006-06-29 Thread Jeff Greif
Take a look at: http://www.w3.org/Submission/2004/SUBM-xmlschema-api-20040122/ An XSParticle has an XSTerm (accessed via getTerm) which is either an XSElementDeclaration or an XSWildcard or an XSModelGroup (sequence, choice or all). It helps to read the above spec in conjunction with the XML Sch

Re: Xerces 1.4.4, XML, XSD and validation

2006-04-20 Thread Jeff Greif
Your schema needs to say elementFormDefault="qualified" in the element. Scott Shaver wrote: = ERROR == [java] Thu Apr 20 13:55:00 MDT 2006 RiverbedShipmentSubscriberMDB.validateSchema(): XML failed validation:cvc-complex-type.2.4.a: Invalid

Re: Xerces 1.4.4, XML, XSD and validation

2006-04-20 Thread Jeff Greif
When you use xsi:schemaLocation, the value should match the pattern "namespace-uri whitespace schema-url" repeated as many times as necessary for all the schemas to be found, and with whitespace separating the groups. This also applies the to "http://apache.org/xml/properties/schema/external- sche

Re: Xerces 1.4.4, XML, XSD and validation

2006-04-20 Thread Jeff Greif
A hunch: It's possible that you need to tell Xerces to "normalize-space" so that the whitespace after the shippingRequestTag is not treated as content, making it appear that your instance document does not match the content model. See the docs for how to do this in that version of Xerces, which is

Re: Usage of SecurityManager's setMaxOccurNodeLimit

2006-04-06 Thread Jeff Greif
Just speculating, but the fact that this occurs in a security manager suggests that this is designed as a denial of service protection (for example by having a recursive entity expansion that turns a small input string into an infinitely large thing to be parsed). It is unlikely to have anything t

Re: xerces DOM concurrent access and defer-node-expansion

2006-03-07 Thread Jeff Greif
If no nodes are being altered by any thread, and deferred-node-expansion is turned off, is the xerces DOM concurrently accessible from multiple threads? Jeff On 3/7/06, Joseph Kesselman <[EMAIL PROTECTED]> wrote: > >The FAQ[1], declares xerces DOM implementation is not thread safe. > > Most DOMs

Re: DOMParser and XML Comments

2005-08-30 Thread Jeff Greif
It's not an xml comment! It's the serialized form of a Text node that's the next sibling of the element. Having non-whitespace text might make the document invalid with respect to its defined grammar (DTD or XML Schema or something else), but perhaps it is not being validated. Jeff Richar

Re: Preparse with existing Grammar Pool

2005-06-23 Thread Jeff Greif
I think this will happen automatically if the parser is configured to use the grammar pool holding the imported grammar. Look at the Xerces "Grammars" FAQ for more details. Jeff Guy Sharon wrote: How do I set the preparser to choose to look first in the GrammarPool and only then to look for

Re: Preparse with existing Grammar Pool

2005-06-23 Thread Jeff Greif
As a matter of specification, to be valid itself, a schema must import all the namespaces it references. In the element it need not specify where to find the imported schema, and if it does specify it, the specification may be ignored by a validator that can access the grammar another way. A