OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] xml xsl web architecture

[ Lists Home | Date Index | Thread Index ]

On 2/23/06, Peter Hunsberger <peter.hunsberger@gmail.com> wrote:
> On 2/23/06, Anthony Ettinger <aettinger@sdsualumni.org> wrote:
> > Why not just do it in the xsl file?
> >
> > The xsl file will be applied to an xml data file from the backend for
> > dynamic data, user info, etc.
> >
> > I assume you mean something like:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <html>
> > <head>
> > <foo:title><arg:text>Some Title</arg:text></foo:title>
> > </head>
> > <body>
> > </body>
> > </html>
> > ...
> >
> > I'm thinking doing this directly in xsl would save the problem of
> > having to write templates for each html tag.
> >
>
> No.  Say in your XSL the XHTML elements have a namespace of "gunk"
> then the generic transform would basically be:
>
> <xsl:template match="gunk:*">
>     <xsl:element name="{local-name()}">
>         <xsl:copy-of select="@*"/>
>         <xsl:apply-templates select="*"/>
>     </xsl:element>
> </xsl:template>
>
> that will strip the namespace off the XHTML elements and send them to
> the front end,  so that an H1 is an H1 a P is a P, etc.  Anything with
> a different name space gets handled according to whatever custom logic
> you need.
>
> --
> Peter Hunsberger
>
>

...so I would still write xhtml in a separate file, just give it a
namespace so the tags stay the same:

<x:html>
     <x:head>
     </x:head>
</x:html>




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS