xsl-list
[Top] [All Lists]

Re[2]: [xsl] How do you remove namespace?

2006-08-14 15:22:26
Hello Michael,

Monday, August 14, 2006, 5:37:47 PM, you wrote:

You can't get rid of the namespace declaration, because without it the
<asp:xyz> and <asp:Label> elements would not be namespace-well-formed.

Perhaps you don't really want these elements to be in the namespace
System.Web.UI.WebControls? But in that case, why would you be putting them
in that namespace?

Or perhaps you're trying to generate output that is neither well-formed XML
nor well-formed HTML? (I guess that might apply to ASP.NET pages?) That's a
tricky one: in principle you can do it by writing your own serializer, but
that might be more work than you want to attempt. The alternative is to
generate XML and then post-process it using a non-XML-aware tool such as
Perl. For example, you could generate output elements named asp.Label
instead of asp:Label.

Michael Kay
http://www.saxonica.com/
 

-----Original Message-----
From: Arthur Maloney [mailto:ArthurM(_at_)seipas(_dot_)com] 
Sent: 14 August 2006 16:56
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] How do you remove namespace?

Hello xsl-list,

  I'm using Xslt 2.0 to author some ASP.Net code building

  in a library xsl file I have:

<xsl:template name="masthead">
<div id="masthead">
     <xsl:element name="asp:xyz">
                  <xsl:attribute name="Id" select="'lblPageTitle'"/>
                  <xsl:attribute name="runat" select="'server'"/>
     </xsl:element>
     <asp:Label Id="lblPageTitle" runat="server" />
     <asp:Label Id="lblPageCaption" runat="server" />
     <asp:Label Id="lblMessage" runat="server" />
</div><!-- end of masthead -->

when called  it gives
      <div id="masthead">
        <asp:xyz runat="server" 
xmlns:asp="System.Web.UI.WebControls" Id="lblPageTitle"></asp:xyz>
        <asp:Label runat="server" 
xmlns:asp="System.Web.UI.WebControls" Id="lblPageTitle"></asp:Label>
      ...
      </div>


I want to get rid of xmlns:asp="System.Web.UI.WebControls"
In the stylesheet element I have:

I have xmlns:asp="System.Web.UI.WebControls

without this I get error SXXP0003 The prefix asp FOR ELEMENT 
asp:Label is not bound


--
Best regards,
 Arthur                          mailto:ArthurM(_at_)seipas(_dot_)com



Thanks Mike, its MS
being neither well-formed XML
nor well-formed HTML? (I guess that might apply to ASP.NET pages?)

I've some c# code generators so I'll probably go that way for asp:
(server controls)

At the moment it more about trying to get to grips with Xslt 2.0.

-- 
Best regards,
 Arthur                            mailto:ArthurM(_at_)seipas(_dot_)com


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>