[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xerces-j-dev
Subject:    Re: Validation with default-Attribute
From:       Prashant Reddy <prashant () pramati ! com>
Date:       2007-08-27 11:46:50
Message-ID: 1188214490.5078.179.camel () localhost
[Download RAW message or body]

If i remember correctly you needed to normalize DOM before default
attributes are inserted by parser. Not sure what is the equivalent for a
StreamResult.

HTH
-Prashant


On Mon, 2007-08-27 at 13:11 +0200, Florian Wendland wrote:
> Hello all,
> 
> I have tried to validate a simple xml document with a simple schema, 
> too. If have only 1 Element with one attribute, which i have defines as 
> optional, but with an default content.
> 
> I had exepected, that xerces would add the default attribute into the 
> psvi (n my case a streamresult-object), but the result is a xml document 
> without the default attribute.
> 
> Here is my Java-Code:
> ##################################################################
> final Result res = new StreamResult(new FileWriter(new 
> File("d:\\output.xml")));
> 
> final Source source = new StreamSource(new FileReader(new 
> File(input.toURI())));
> 
> SchemaFactory sf = SchemaFactory.newInstance(NAMESPACE);
> 
> Schema f = sf.newSchema(schema);
> 
> Validator val =    f.newValidator();
> 
> val.validate(source, res);
> ##################################################################
> 
> Did i miss something?
> Thx
> mfw
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org


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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic