prefix namespace as ns0

H

Hetal

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:eek:ffice: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:eek:="urn:schemas-microsoft-com:eek:ffice:eek:ffice"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:ns0="http://tempuri.org/DocumentSchema.xsd" w:macrosPresent="no"
w:embeddedObjPresent="no" w:eek:cxPresent="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:eek:ffice: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:eek:="urn:schemas-microsoft-com:eek:ffice:eek:ffice"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:ns1="http://tempuri.org/DocumentSchema.xsd" w:macrosPresent="no"
w:embeddedObjPresent="no" w:eek:cxPresent="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?
 
D

Daiya Mitchell

You’ve landed in a MacWord group. There is a Word XML group somewhere (I
think), but not sure where. Look harder for it.
 
J

John McGhie

Cross-posting into two more appropriate groups....

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:eek:ffice: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:eek:="urn:schemas-microsoft-com:eek:ffice:eek:ffice"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:ns0="http://tempuri.org/DocumentSchema.xsd" w:macrosPresent="no"
w:embeddedObjPresent="no" w:eek:cxPresent="no"
xml:space="preserve"><o:DocumentProperties><o:Author>hshah1</o:Author><o:LaLin
es><o:paragraphs>1</o:paragraphs><o:CharactersWithSpaces>26</o:CharactersWithS
paces><o:Version>11.6359</o:Version></o:DocumentProperties><w:fonts><-ŠŠŠŠŠŠŠŠ
ŠŠŠŠŠŠŠŠŠŠŠŠŠ
pTextWithPunct/><w:useAsianBreakRules/><w:dontGrowAutofit/></w:compat></w:docP
r><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:Fi
eld></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:eek:ffice: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:eek:="urn:schemas-microsoft-com:eek:ffice:eek:ffice"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:ns1="http://tempuri.org/DocumentSchema.xsd" w:macrosPresent="no"
w:embeddedObjPresent="no" w:eek:cxPresent="no"
xml:space="preserve"><o:DocumentProperties><o:Author>hshah1</o:Author><o:LastA
uthor>hshah1</o:LastAuthor><o:Revision>1</o:Revision><o:TotalTime>4</o:TotalTi
me><o:Created>2008-01-23T09:43:00Z</o:Created><o:LastSaved>2008-01-23T09:55:00
Z</o:LastSaved><o:pages>1</o:pages><o:Words>4</o:Words><o:Characters>23</o:Cha
racters><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:wrapText

</w:t></w:r></w:p><w:p><ns1:Item><ns1:Field><w:r><w:t>Name</w:t></w:r></ns1:Fi
eld></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?

--
Don't wait for your answer, click here: http://www.word.mvps.org/

Please reply in the group. Please do NOT email me unless I ask you to.

John McGhie, Consultant Technical Writer
McGhie Information Engineering Pty Ltd
http://jgmcghie.fastmail.com.au/
Sydney, Australia. S33°53'34.20 E151°14'54.50
+61 4 1209 1410, mailto:[email protected]
 

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