You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Cirip Tomas <to...@theIMO.com> on 2002/03/28 21:07:17 UTC

Is it possible to get DTDGrammar from parser?

Hi,
 
Is there any way to get DTD grammar from a parser after parsing XML file?
 
Tomas

Re: Is it possible to get DTDGrammar from parser?

Posted by Andy Clark <an...@apache.org>.
Cirip Tomas wrote:
> Is there any way to get DTD grammar from a parser after parsing XML
> file?

...as an object with convenient API that you can access? No.
But we're looking at grammar caching for DTDs now and also the 
DOM L3 abstract schemas implementation for DTDs. So we will
have what you need in time. 

At the moment, though, you'll have to register the appropriate 
DTD handler(s) to receive the information that you need and 
build whatever grammar object you want.

-- 
Andy Clark * andyc@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


what's wrong with the declaration:

Posted by Evgueni Rouban <re...@nbsp.nsk.su>.
what's wrong with the following element
declaration: 

<xsd:element name="e" default="1"/>

note, that if the type is set to "xsd:string" it is ok.
<xsd:element name="e" type="xsd:string" default="1"/>

Thanks.
-Evgueni

P.S. try the following schema and document:
----------------------------------- valueConstraint.xsd
<xsd:schema
  xmlns="valueConstraint"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  targetNamespace="valueConstraint">

  <xsd:element name="root" type="xsd:string" default="0" />

</xsd:schema>

----------------------------------- valueConstraint.xml
<test:root
    xmlns:test="valueConstraint"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="valueConstraint valueConstraint.xsd"/>

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org