Hi i want to prefix namespace as ns0 , my procedure is i have one xml schema file, that schema file i am adding in word 2003 using xml sturture panel. now from that xml schema i am adding placeholders in word document. and then save the document as .xml (wordml). following is my schema file <?xml version="1.0" encoding="utf-8"?> <xs:schema id="DocumentSchema" targetNamespace="http://tempuri.org/DocumentSchema.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/DocumentSchema.xsd" xmlns:mstns="http://tempuri.org/DocumentSchema.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Root"> <xs:complexType> <xs:sequence> <xs:element name="Item" type="Item" minOccurs="0" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> </xs:element> <xs:complexType name="Field" mixed="true"> <xs:attribute name="Target" type="xs:string" /> </xs:complexType> <xs:complexType name="Row" mixed="true"> <xs:sequence> <xs:element name="Item" type="Item" minOccurs="0" maxOccurs="unbounded" /> </xs:sequence> <xs:attribute name="Target" type="xs:string" /> <xs:attribute name="Position" type="xs:integer" use="optional" /> <xs:attribute name="Separator" type="Separator" use="optional" /> <xs:attribute name="Layout" type="Layout" /> </xs:complexType> <xs:complexType name="ITE" mixed="true"> <xs:sequence> <xs:element name="TruePart" type="ITEPart" minOccurs="1" maxOccurs="1" /> <xs:element name="FalsePart" type="ITEPart" minOccurs="1" maxOccurs="1" /> </xs:sequence> <xs:attribute name="Target" type="xs:string" /> </xs:complexType> <xs:simpleType name="Layout"> <xs:restriction base="xs:string"> <xs:enumeration value="Table" /> <xs:enumeration value="Flow" /> <xs:enumeration value="Individual" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="Separator"> <xs:restriction base="xs:string"> <xs:enumeration value="NoSeparator" /> <xs:enumeration value="Comma" /> <xs:enumeration value="And" /> <xs:enumeration value="Or" /> <xs:enumeration value="LineBreak" /> </xs:restriction> </xs:simpleType> <xs:complexType name="Item" mixed="true"> <xs:choice> <xs:element name="Row" type="Row" /> <xs:element name="Field" type="Field" /> <xs:element name="ITE" type="ITE" /> </xs:choice> </xs:complexType> <xs:complexType name="ITEPart" mixed="true"> <xs:sequence> <xs:element name="Item" type="Item" minOccurs="0" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> </xs:schema> so after saving xml document if will open that document in notepad and it will look something like <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?mso-application progid="Word.Document"?> <w:wordDocument xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:ns1="http://tempuri.org/DocumentSchema.xsd" w:macrosPresent="no" w:embeddedObjPresent="no" w:ocxPresent="no" xml:space="preserve"><o:DocumentProperties><o:Author>hshah1</o:Author><o:LastAuthor>hshah1</o:LastAuthor><o:Revision>1</o:Revision><o:TotalTime>1</o:TotalTime><o:Created>2008-01-22T09:11:00Z</o:Created><o:LastSaved>2008-01-22T09:12:00Z</o:LastSaved><o:Pages>1</o:Pages><o:Words>4</o:Words><o:Characters>24</o:Characters><o:Company>DISCOVERIT</o:Company><o:Lines>1</o:Lines><o:Paragraphs>1</o:Paragraphs><o:CharactersWithSpaces>27</o:CharactersWithSpaces><o:Version>11.6359</o:Version></o:DocumentProperties><w:fonts><w:defaultFonts w:ascii="Times New Roman" w:fareast="Times New Roman" w:h-ansi="Times New Roman" w:cs="Times New Roman"/></w:fonts><w:styles><w:versionOfBuiltInStylenames w:val="4"/><w:latentStyles w:defLockedState="off" w:latentStyleCount="156"/><w:style w:type="paragraph" w:default="on" w:styleId="Normal"><w:name w:val="Normal"/><w:rPr><wx:font wx:val="Times New Roman"/><w:sz w:val="24"/><w:sz-cs w:val="24"/><w:lang w:val="EN-GB" w:fareast="EN-GB" w:bidi="AR-SA"/></w:rPr></w:style><w:style w:type="character" w:default="on" w:styleId="DefaultParagraphFont"><w:name w:val="Default Paragraph Font"/><w:semiHidden/></w:style><w:style w:type="table" w:default="on" w:styleId="TableNormal"><w:name w:val="Normal Table"/><wx:uiName wx:val="Table Normal"/><w:semiHidden/><w:rPr><wx:font wx:val="Times New Roman"/></w:rPr><w:tblPr><w:tblInd w:w="0" w:type="dxa"/><w:tblCellMar><w:top w:w="0" w:type="dxa"/><w:left w:w="108" w:type="dxa"/><w:bottom w:w="0" w:type="dxa"/><w:right w:w="108" w:type="dxa"/></w:tblCellMar></w:tblPr></w:style><w:style w:type="list" w:default="on" w:styleId="NoList"><w:name w:val="No List"/><w:semiHidden/></w:style></w:styles><w:docPr><w:view w:val="print"/><w:zoom w:percent="100"/><w:doNotEmbedSystemFonts/><w:proofState w:spelling="clean" w:grammar="clean"/><w:attachedTemplate w:val=""/><w:defaultTabStop w:val="720"/><w:punctuationKerning/><w:characterSpacingControl w:val="DontCompress"/><w:optimizeForBrowser/><w:validateAgainstSchema/><w:saveInvalidXML/><w:ignoreMixedContent w:val="off"/><w:alwaysShowPlaceholderText w:val="off"/><w:compat><w:breakWrappedTables/><w:snapToGridInCell/><w:wrapTextWithPunct/><w:useAsianBreakRules/><w:dontGrowAutofit/></w:compat></w:docPr><w:body><wx:sect><ns1:Root><w:p/><w:p><ns1:Item><ns1:Field><w:r><w:t>Name</w:t></w:r></ns1:Field></ns1:Item><w:r><w:t> </w:t></w:r></w:p><w:p><ns1:Item><ns1:Field><w:r><w:t>Address1</w:t></w:r></ns1:Field></ns1:Item><w:r><w:t> </w:t></w:r></w:p><w:p/></ns1:Root><w:sectPr><w:pgSz w:w="11906" w:h="16838"/><w:pgMar w:top="1440" w:right="1800" w:bottom="1440" w:left="1800" w:header="708" w:footer="708" w:gutter="0"/><w:cols w:space="708"/><w:docGrid w:line-pitch="360"/></w:sectPr></wx:sect></w:body></w:wordDocument> now all namespace is store as ns1 which i want ns0. it is not consistant , so i want to prefix as ns0 only. can any body give clue what can i do ? Thanks Hetal
"Hetal" wrote in message news:27E4FA32-1379-40C5-A1A1-AF49B4B631FF@microsoft.com... > Hi > i want to prefix namespace as ns0 , my procedure is > i have one xml schema file, that schema file i am adding in word 2003 > using > xml sturture panel. now from that xml schema i am adding placeholders in > word > document. and then save the document as .xml (wordml). > following is my schema file > > <?xml version="1.0" encoding="utf-8"?> > <xs:schema id="DocumentSchema" > targetNamespace="http://tempuri.org/DocumentSchema.xsd" > elementFormDefault="qualified" > xmlns="http://tempuri.org/DocumentSchema.xsd" > xmlns:mstns="http://tempuri.org/DocumentSchema.xsd" > xmlns:xs="http://www.w3.org/2001/XMLSchema"> > <xs:element name="Root"> > <xs:complexType> > <xs:sequence> > <xs:element name="Item" type="Item" minOccurs="0" > maxOccurs="unbounded" /> > </xs:sequence> > </xs:complexType> > </xs:element> > <xs:complexType name="Field" mixed="true"> > <xs:attribute name="Target" type="xs:string" /> > </xs:complexType> > <xs:complexType name="Row" mixed="true"> > <xs:sequence> > <xs:element name="Item" type="Item" minOccurs="0" > maxOccurs="unbounded" /> > </xs:sequence> > <xs:attribute name="Target" type="xs:string" /> > <xs:attribute name="Position" type="xs:integer" use="optional" /> > <xs:attribute name="Separator" type="Separator" use="optional" /> > <xs:attribute name="Layout" type="Layout" /> > </xs:complexType> > <xs:complexType name="ITE" mixed="true"> > <xs:sequence> > <xs:element name="TruePart" type="ITEPart" minOccurs="1" > maxOccurs="1" > /> > <xs:element name="FalsePart" type="ITEPart" minOccurs="1" > maxOccurs="1" /> > </xs:sequence> > <xs:attribute name="Target" type="xs:string" /> > </xs:complexType> > <xs:simpleType name="Layout"> > <xs:restriction base="xs:string"> > <xs:enumeration value="Table" /> > <xs:enumeration value="Flow" /> > <xs:enumeration value="Individual" /> > </xs:restriction> > </xs:simpleType> > <xs:simpleType name="Separator"> > <xs:restriction base="xs:string"> > <xs:enumeration value="NoSeparator" /> > <xs:enumeration value="Comma" /> > <xs:enumeration value="And" /> > <xs:enumeration value="Or" /> > <xs:enumeration value="LineBreak" /> > </xs:restriction> > </xs:simpleType> > <xs:complexType name="Item" mixed="true"> > <xs:choice> > <xs:element name="Row" type="Row" /> > <xs:element name="Field" type="Field" /> > <xs:element name="ITE" type="ITE" /> > </xs:choice> > </xs:complexType> > <xs:complexType name="ITEPart" mixed="true"> > <xs:sequence> > <xs:element name="Item" type="Item" minOccurs="0" > maxOccurs="unbounded" /> > </xs:sequence> > </xs:complexType> > </xs:schema> > > so after saving xml document if will open that document in notepad and it > will look something like > > <?xml version="1.0" encoding="UTF-8" standalone="yes"?> > <?mso-application progid="Word.Document"?> > <w:wordDocument > xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" > xmlns:v="urn:schemas-microsoft-com:vml" > xmlns:w10="urn:schemas-microsoft-com:office:word" > xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core" > xmlns:aml="http://schemas.microsoft.com/aml/2001/core" > xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" > xmlns:o="urn:schemas-microsoft-com:office:office" > xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" > xmlns:ns1="http://tempuri.org/DocumentSchema.xsd" w:macrosPresent="no" > w:embeddedObjPresent="no" w:ocxPresent="no" > xml:space="preserve"><o:DocumentProperties><o:Author>hshah1</o:Author><o:LastAuthor>hshah1</o:LastAuthor><o:Revision>1</o:Revision><o:TotalTime>1</o:TotalTime><o:Created>2008-01-22T09:11:00Z</o:Created><o:LastSaved>2008-01-22T09:12:00Z</o:LastSaved><o:Pages>1</o:Pages><o:Words>4</o:Words><o:Characters>24</o:Characters><o:Company>DISCOVERIT</o:Company><o:Lines>1</o:Lines><o:Paragraphs>1</o:Paragraphs><o:CharactersWithSpaces>27</o:CharactersWithSpaces><o:Version>11.6359</o:Version></o:DocumentProperties><w:fonts><w:defaultFonts > w:ascii="Times New Roman" w:fareast="Times New Roman" w:h-ansi="Times New > Roman" w:cs="Times New > Roman"/></w:fonts><w:styles><w:versionOfBuiltInStylenames > w:val="4"/><w:latentStyles w:defLockedState="off" > w:latentStyleCount="156"/><w:style w:type="paragraph" w:default="on" > w:styleId="Normal"><w:name w:val="Normal"/><w:rPr><wx:font wx:val="Times > New > Roman"/><w:sz w:val="24"/><w:sz-cs w:val="24"/><w:lang w:val="EN-GB" > w:fareast="EN-GB" w:bidi="AR-SA"/></w:rPr></w:style><w:style > w:type="character" w:default="on" w:styleId="DefaultParagraphFont"><w:name > w:val="Default Paragraph Font"/><w:semiHidden/></w:style><w:style > w:type="table" w:default="on" w:styleId="TableNormal"><w:name > w:val="Normal > Table"/><wx:uiName wx:val="Table Normal"/><w:semiHidden/><w:rPr><wx:font > wx:val="Times New Roman"/></w:rPr><w:tblPr><w:tblInd w:w="0" > w:type="dxa"/><w:tblCellMar><w:top w:w="0" w:type="dxa"/><w:left w:w="108" > w:type="dxa"/><w:bottom w:w="0" w:type="dxa"/><w:right w:w="108" > w:type="dxa"/></w:tblCellMar></w:tblPr></w:style><w:style w:type="list" > w:default="on" w:styleId="NoList"><w:name w:val="No > List"/><w:semiHidden/></w:style></w:styles><w:docPr><w:view > w:val="print"/><w:zoom > w:percent="100"/><w:doNotEmbedSystemFonts/><w:proofState > w:spelling="clean" > w:grammar="clean"/><w:attachedTemplate w:val=""/><w:defaultTabStop > w:val="720"/><w:punctuationKerning/><w:characterSpacingControl > w:val="DontCompress"/><w:optimizeForBrowser/><w:validateAgainstSchema/><w:saveInvalidXML/><w:ignoreMixedContent > w:val="off"/><w:alwaysShowPlaceholderText > w:val="off"/><w:compat><w:breakWrappedTables/><w:snapToGridInCell/><w:wrapTextWithPunct/><w:useAsianBreakRules/><w:dontGrowAutofit/></w:compat></w:docPr><w:body><wx:sect><ns1:Root><w:p/><w:p><ns1:Item><ns1:Field><w:r><w:t>Name</w:t></w:r></ns1:Field></ns1:Item><w:r><w:t> > </w:t></w:r></w:p><w:p><ns1:Item><ns1:Field><w:r><w:t>Address1</w:t></w:r></ns1:Field></ns1:Item><w:r><w:t> > </w:t></w:r></w:p><w:p/></ns1:Root><w:sectPr><w:pgSz w:w="11906" > w:h="16838"/><w:pgMar w:top="1440" w:right="1800" w:bottom="1440" > w:left="1800" w:header="708" w:footer="708" w:gutter="0"/><w:cols > w:space="708"/><w:docGrid > w:line-pitch="360"/></w:sectPr></wx:sect></w:body></w:wordDocument> > > > now all namespace is store as ns1 which i want ns0. it is not consistant , > so i want to prefix as ns0 only. > can any body give clue what can i do ? > > Thanks > Hetal > > It's a strange request, it shouldn't really matter what the prefix is. I'm not a Word expert but I know you can attach an XSL transform to run on a document so you could write one that changes the prefix. Why do you need such a requirement? -- Joe Fawcett (MVP - XML) http://joe.fawcett.name
Hi i want to prefix namespace as ns0 , my procedure is â¦i have one xml schema file, that schema file i am adding in word 2003 using xml sturture panel. now from that xml schema i am adding placeholders in word document. and then save the document as .xml (wordml). following is example of schema file <?xml version="1.0" encoding="utf-8"?> <xs:schema id="DocumentSchema" targetNamespace="http://tempuri.org/DocumentSchema.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/DocumentSchema.xsd" xmlns:mstns="http://tempuri.org/DocumentSchema.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Root"> â¦.. â¦.. </xs:schema> so after saving xml document if will open that document in notepad and it will look something like <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?mso-application progid="Word.Document"?> <w:wordDocument xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:ns0="http://tempuri.org/DocumentSchema.xsd" w:macrosPresent="no" w:embeddedObjPresent="no" w:ocxPresent="no" xml:space="preserve"><o:DocumentProperties><o:Author>hshah1</o:Author><o:LaLines><o:Paragraphs>1</o:Paragraphs><o:CharactersWithSpaces>26</o:CharactersWithSpaces><o:Version>11.6359</o:Version></o:DocumentProperties><w:fonts><-â¦â¦â¦â¦â¦â¦â¦â¦ â¦â¦â¦â¦â¦â¦â¦â¦â¦â¦â¦â¦â¦ pTextWithPunct/><w:useAsianBreakRules/><w:dontGrowAutofit/></w:compat></w:docPr><w:body><wx:sect><ns0:Root><w:p/><w:p><ns0:Item><ns0:Field><w:r><w:t>Address</w:t></w:r></ns0:Field></ns0:Item><w:r><w:t> </w:t></w:r></w:p><w:p><ns0:Item><ns0:Field><w:r><w:t>Name</w:t></w:r></ns0:Field></ns0:Item><w:r><w:t> </w:t></w:r></w:p><w:p/></ns0:Root><w:sectPr><w:pgSz w:w="11906" w:h="16838"/><w:pgMar w:top="1440" w:right="1800" w:bottom="1440" w:left="1800" w:header="708" w:footer="708" w:gutter="0"/><w:cols w:space="708"/><w:docGrid w:line-pitch="360"/></w:sectPr></wx:sect></w:body></w:wordDocument> now all namespace is store as ns0, which is ok for me but If change schema from tempuri.org to abc.com .. like following <?xml version="1.0" encoding="utf-8"?> <xs:schema id="DocumentSchema" targetNamespace="http://abc.com/DocumentSchema.xsd" elementFormDefault="qualified" xmlns="http:// abc.com /DocumentSchema.xsd" xmlns:mstns="http:// abc.com /DocumentSchema.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Root"> â¦.. â¦.. </xs:schema> then follow all the procedure from beginning like . Remove schema file and then close the word document , again open and add schema file , add few placeholders using schema file , save document as .xml(wordml) And if will open that xml file in notepad it change namespace with ns1 or ns2 or ns3 Something like following .. <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?mso-application progid="Word.Document"?> <w:wordDocument xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:ns1="http://tempuri.org/DocumentSchema.xsd" w:macrosPresent="no" w:embeddedObjPresent="no" w:ocxPresent="no" xml:space="preserve"><o:DocumentProperties><o:Author>hshah1</o:Author><o:LastAuthor>hshah1</o:LastAuthor><o:Revision>1</o:Revision><o:TotalTime>4</o:TotalTime><o:Created>2008-01-23T09:43:00Z</o:Created><o:LastSaved>2008-01-23T09:55:00Z</o:LastSaved><o:Pages>1</o:Pages><o:Words>4</o:Words><o:Characters>23</o:Characters><o:Company>DISCOVERIT</o:Company><o:Lines>1</o:Lines><o:Paragraphs>1</o:Paragraphs><o:CharactersWithSpaces>26</o: â¦â¦â¦â¦â¦â¦.. â¦â¦â¦â¦â¦â¦.. /><w:saveInvalidXML/><w:ignoreMixedContent w:val="off"/><w:alwaysShowPlaceholderText w:val="off"/><w:compat><w:breakWrappedTables/><w:snapToGridInCell/><w:wrapTextWithPunct/><w:useAsianBreakRules/><w:dontGrowAutofit/></w:compat></w:docPr><w:body><wx:sect><ns1:Root><w:p/><w:p><ns1:Item><ns1:Field><w:r><w:t>Address</w:t></w:r></ns1:Field></ns1:Item><w:r><w:t> </w:t></w:r></w:p><w:p><ns1:Item><ns1:Field><w:r><w:t>Name</w:t></w:r></ns1:Field></ns1:Item><w:r><w:t> </w:t></w:r></w:p><w:p/></ns1:Root><w:sectPr><w:pgSz w:w="11906" w:h="16838"/><w:pgMar w:top="1440" w:right="1800" w:bottom="1440" w:left="1800" w:header="708" w:footer="708" w:gutter="0"/><w:cols w:space="708"/><w:docGrid w:line-pitch="360"/></w:sectPr></wx:sect></w:body></w:wordDocument> So my problem is I want namespace to be consistence as ns0 How can I do?