You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Sheng Liang (SH/RDC)" <sh...@ericsson.com> on 2004/12/03 06:34:39 UTC
How to add element with default value?
Hi:
I am handling some XML document with Xerces. The version that I am using is 2.4
My task is:
1. validate the XML document to a XML schema, which is achived already.
2. if some elements with default value in schema don't present in XML document,
add them in the document.
I am studying on the requirement 2. I am not sure whether Xerces can fulfill the requirement.
What features are needed to achieve it? Do I need to upgrade the Xerces to 2.6 in this task?
Best Regards
Sheng Liang
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
Re: How to add element with default value?
Posted by Gareth Reakes <ga...@parthenoncomputing.com>.
Hi,
You can't do 2 with XML Schema. You could write some code to
navigate the schema grammar to find specific items and add them in
yourself.For more details on default values take a look at section 2.2.1 in
http://www.w3.org/TR/xmlschema-0/
Gareth
Sheng Liang (SH/RDC) wrote:
>Hi:
> I am handling some XML document with Xerces. The version that I am using is 2.4
>My task is:
> 1. validate the XML document to a XML schema, which is achived already.
> 2. if some elements with default value in schema don't present in XML document,
>add them in the document.
> I am studying on the requirement 2. I am not sure whether Xerces can fulfill the requirement.
>What features are needed to achieve it? Do I need to upgrade the Xerces to 2.6 in this task?
>
>
> Best Regards
>
>
>Sheng Liang
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>
>
>
>
--
Gareth Reakes, Managing Director Parthenon Computing
+44-1865-811184 http://www.parthcomp.com
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org