MSXML 6: transformNode qualifies default injected attributes with a full URI

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I applied the following transformation to itself using MSXML 6.0:
<pre class="prettyprint <?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation
=
"
http://schemas.microsoft.com/office/word/2003/wordml
file:///C:/Microsoft%20Office%202003%20Developer%20Resources/Microsoft%20Office%202003%20XML%20Reference%20Schemas/WordprocessingML%20Schemas/wordnet.xsd

<xsl:template match="/" >
<w:wordDocument >
<w:body ></w:body>
</w:wordDocument>

</xsl:template>
</xsl:stylesheet>
[/code]
I got the following result:
<pre class="prettyprint <?xml version="1.0"?><w:wordDocument http://schemas.microsoft.com/office/word/2003/wordml:macrosPresent="no" http://schemas.microsoft.com/office/word/2003/wordml:embeddedObjPresent="no" http://schemas.microsoft.com/office/word/2003/wordml:ocxPresent="no" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:http://schemas.microsoft.com/office/word/2003/wordml="http://schemas.microsoft.com/office/word/2003/wordml <w:body></w:body></w:wordDocument>[/code]
This result is invalid and cannot be saved. The correct result would be:
<pre class="prettyprint <?xml version="1.0"?><w:wordDocument w:macrosPresent="no" w:embeddedObjPresent="no" w:ocxPresent="no" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ><w:body></w:body></w:wordDocument>[/code]
Note that the attributes with invalid names are inserted by the schema. Is there a way to avoid this under ResolveExternals, other than specifying the default attributes explicitly?<br/><hr class="sig Christopher Yeleighton

View the full article
 
Back
Top