I forgot to include the xsl template that is performing the transform.
This provides the two outputs (correct and incorrect) below.
I am not using any code. The XML and XSL documents are not manipulated at
all. I guess I just need some code to ignore or handle the namespace
reference at the root of the document. If I need to do something different,
"Derek Harmon" <loresayer@msn.com> wrote in message
news:Op3wc3gmEHA.1644@tk2msftngp13.phx.gbl...
> "Don" <doduong12141214@hotmail.com> wrote in message
news:O%23FpvMdmEHA.3872@TK2MSFTNGP09.phx.gbl...
> > If I leave that name space reference in the document, my document
renders
> > incorrectly (see below). I must remove it in order to render correctly.
So
> > it's an annoyance adding and removing this thing all the time just to
get
> > some intellisense. As you mentioned, I should probably make all my
> > transformations "namespace aware"... and how do I do that in this case?
>
> You show two .xsl transformations. One looks 'empty' and you state
> that's what gets created without a namespace declaration?
>
> : :
> > *Without the namespace reference* -- This is the incorrect one
> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"> > > <xsl:template name="">
> > <form method="" name="" action="">
> > </form>
> > </xsl:template>
> > </xsl:stylesheet>
>
> The other has content, although it has no main template, it doesn't
> seem to depend on any XML node set, and I can't see how it's been
> executed. This you've stated has a namespace declaration.
>
> : :
> > *With the namespace reference* --This is the correct one
> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"> > > <xsl:template name="iClas_form"><link rel="stylesheet" type="text/css"
> > href="/CSS/corporate.css" /><script type="text/javascript"
> > src="/include/helper.js"></script></xsl:template>
> > </xsl:stylesheet>
>
> If having the namespace declaration produces the correct
> stylesheet, and produces IntelliSense from the schema, the
> problem is what?
>
> OK, let's look at the XML document.
>
> > <?xml version="1.0" encoding="utf-8" ?>
> > <WEBFORM xmlns="
http://tempuri.org/formgenerator.xsd" > > templatename="iClas_form">
> > <SECTION VERSION="1" SName="form" WIDTH="646">
> > <SUBSECTION SName="form1">
> > <GROUP>
> > <INPUT VERSION="1" TYPE="Text" FName="1. Could I have your first
name
> > please?" Name="FirstName"
> > XPath="/document/iClas_Contact[index='1']/Borrower/FirstName"
> > MAXLENGTH="15" SIZE="36"
> > DataType="String" ONCHANGE="" />
> > </GROUP>
> > </SUBSECTION>
> > </SECTION>
> > </WEBFORM>
>
> My guess is you're reading this XML in and generating the XSLT.
> Whatever program is reading this takes the templatename attribute
> value, iClas_form, and puts it into the stylesheet.
>
> Now, if having the namespace URI declared is causing the template-
> name attribute to not be found, then it's conceivable an empty name
> attribute will be generated in the stylesheet.
>
> What you have to do is change the code you're using to select that
> attribute to respect the
http://tempuri.org/formgenerator.xsd name-
> space URI, because when there's a namespace declaration your
> document doesn't contain a templatename attribute. Instead, it
> contains a "
http://tempuri.org/formgenerator.xsd:templatename"
> attribute (which is distinguishable from the non-namespace
> qualified "templatename").
>
> You haven't shown the program code that's selecting the
> templatename attribute, so I can't provide anymore details.
> However, if you're using SelectNodes to use XPath to find
> it, then you need to create an XmlNamespaceManager w/
> a prefix associated with
http://tempuri.org/formgenerator.xsd > and use that prefix in your XPath expression. Then use this
> prefix-qualified XPath expression and the XmlNamespace-
> Manager you created in the call to SelectNodes.
>
> XmlNamespaceManager nsMan = new XmlNamespaceManager( doc.NameTable);
> nsMan.AddNamespace("tns", "
http://tempuri.org/formgenerator.xsd");
> XmlNode templName = doc.SelectSingleNode(
> "//tns:WEBFORM/@tns:templatename",
> nsMan
> );
>
>
> Derek Harmon
>
>