Default Value For XML Not Appearing

T

Trevor

Word seems to be ignoring the default values I have specified for an
element in a XML schema definition. When I add an element of type
"some_element", it does not appear with the text "some_value". Why is
this?

Here is the schema:

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.w3schools.com"
xmlns="http://www.w3schools.com"
elementFormDefault="qualified">

<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:element name="some_element" type="xs:string"
default="some_value"/>
</xs:sequence>
</xs:complexType>
</xs:element>

</xs:schema>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top