XSLT template for <email>

Hiroki Sato hrs at FreeBSD.org
Tue Dec 4 17:43:24 UTC 2012


René Ladan <rene at freebsd.org> wrote
  in <50BE2FF1.9050901 at freebsd.org>:

re> Hi,
re> 
re> as of r40266 of the projects/entities branch one can write
re> &committer.email; in $LANG/htdocs which then gets expanded as defined in
re> share/xml/authors.ent, so:
re> 
re> authors.ent:
re> <!ENTITY a.greenpuppet "Green Puppet">
re> <!ENTITY a.greenpuppet.email "&a.greenpuppet;
re> <email>greenpuppet at FreeBSD.org</email>">
re> 
re> administration.xml:
re> ... some story about ET ...
re> &a.greenpuppet.email;
re> 
re> administration.html:
re> ... some story about ET ...
re> Green Puppet <email
re> xmlns="http://www.FreeBSD.org/XML/email">greenpuppet at reeBSD.org</email>
re> 
re> The xmlns attribute is defined in share/xml/email.dtd and is required to
re> keep xmllint (which is run for each XML document) happy.
re> 
re> The attached patch for share/xml/xhtml.xsl defines a template to convert
re> the <email> tag into XHTML but it looks the template is never reached.
re> The template above it (process.contentwrap) includes an xsl:copy-of
re> statement which copies the body of the XML document verbatim, leaving
re> <email> tags as-is.
re> 
re> So how to get the new template to do its job?  Should part of the
re> process.contentwrap be rewritten?

 | +  <xsl:template match="email">

 You needed to add namespace for email element if you did not define
 it.  This is because the default namespace in <xsl:stylesheet> is
 defined as xmlns="http://www.w3.org/1999/xhtml" in xhtml.xsl.

-- Hiroki
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-doc/attachments/20121205/f1e72f97/attachment.sig>


More information about the freebsd-doc mailing list