Date: Tue, 04 Dec 2012 22:17:57 +0100 From: =?ISO-8859-1?Q?Ren=E9_Ladan?= <rene@freebsd.org> To: Hiroki Sato <hrs@FreeBSD.org> Cc: doc@FreeBSD.org Subject: Re: XSLT template for <email> Message-ID: <50BE6885.3000607@freebsd.org> In-Reply-To: <20121205.023702.5802241737895160.hrs@allbsd.org> References: <50BE2FF1.9050901@freebsd.org> <20121205.023702.5802241737895160.hrs@allbsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------080406010206090905030707 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 04-12-2012 18:37, Hiroki Sato wrote: > René Ladan <rene@freebsd.org> wrote in > <50BE2FF1.9050901@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@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@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. > Do you mean what is described in the attached new patch, or that all <email> elements in authors.ent need to have a namespace definition as attribute (which would make it very cumbersome)? The generated administration.xml now looks a bit different but the <email> tags are not converted yet. René -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with undefined - http://www.enigmail.net/ iQIcBAEBAgAGBQJQvmiEAAoJEK27+GEKN4m3LKgP/iEhZ9UhzoY8L+V5cQS5b7wM USY43VUvi2XXpfBsNa8WSSO3maCdW8s3F2L6B3yWQPreLLGPIAiSsUiQ9+CzYH01 Ojl5CdgQ9WRoVT09KThv4cZkXd8BU+MERtfttyepzv4uIzowVa3SdqbRDPypUWWh cN1jkjxOSAxPxqZGGwdHd7fn94BcNzYHEf7rlxEsVhV0P6OidvnZun6ZoxViMfGT trQlWFzc6An8K4X0MmBoxhYrc7efUwNshlXh+nLRnTg91x/l99CZtXql5oCqzLTw arvxM+vmfYiOqgEm7AcrO+Cs8WWgpDOLNypSOj7RmBtsk3M1zvu4pnmW3irEQuHl ZQRF4dH6YKHt3hhEdta8H6C5ciia5hq59LXG334Gl1scAvG6I3RBNt82lWSfzqhC KTheSg2BW1yYFYK+8B2nUQOI2VGpam2yJejajo3tkipmtvlHST+AlpmsbmIfBzvQ DmB7uEaJ1gOyoGIZqHRingC9keyZmNFBmPSin/In/f6bXE9gqWHONyQyxs5jlzBC L43X+s9mLBMXUzuFzLKV0bJPNBQw/fXzUMAyAOjDVekBCPYpEvzARxlnldFe4mqL wbixaAIM+d4vOMf4uOoTd3nCfkwfWGsaEzvZcS88fi589kBrSHIS9FacwF3IRPqZ yc1oJHLhFF3eXe8wdX/a =mwrD -----END PGP SIGNATURE----- --------------080406010206090905030707 Content-Type: text/plain; charset=UTF-8; name="xslt-email-2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xslt-email-2.diff" Index: share/xml/email.dtd =================================================================== --- share/xml/email.dtd (revision 40265) +++ share/xml/email.dtd (working copy) @@ -2,4 +2,5 @@ <!ATTLIST email role (nolink) #IMPLIED xmlns CDATA "http://www.FreeBSD.org/XML/email" + xmlns:email CDATA "http://www.FreeBSD.org/XML/email" > Index: share/xml/xhtml.xsl =================================================================== --- share/xml/xhtml.xsl (revision 40265) +++ share/xml/xhtml.xsl (working copy) @@ -6,10 +6,11 @@ <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cvs="http://www.FreeBSD.org/XML/CVS" + xmlns:email="http://www.FreeBSD.org/XML/email" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:str="http://exslt.org/strings" xmlns="http://www.w3.org/1999/xhtml" - exclude-result-prefixes="cvs xhtml" + exclude-result-prefixes="cvs xhtml email" extension-element-prefixes="str"> <xsl:variable name="rsslink" select="''"/> @@ -159,6 +160,23 @@ <xsl:copy-of xmlns:xhtml="http://www.w3.org/1999/xhtml" select="xhtml:html/xhtml:body/*" /> </xsl:template> + <xsl:template match="email:email"> + <xsl:text><</xsl:text> + <xsl:choose> + <xsl:when test="@role='nolink'"> + <xsl:value-of select="email:email" /> + </xsl:when> + <xsl:otherwise> + <a> + <xsl:attribute name="href">mailto:<xsl:value-of select="email:email" /></xsl:attribute> + <!-- auto-generated? --> <xsl:attribute name="shape">rect</xsl:attribute> + <xsl:value-of select="email:email" /> + </a> + </xsl:otherwise> + </xsl:choose> + <xsl:text>></xsl:text> + </xsl:template> + <xsl:template name="process.footer"> ©right;<br/> <xsl:if test="$date != ''"> --------------080406010206090905030707 Content-Type: application/octet-stream; name="xslt-email-2.diff.sig" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="xslt-email-2.diff.sig" iQIcBAABAgAGBQJQvmiEAAoJEK27+GEKN4m3bYsQAIiKYzbLD/bvCWS6PjZ+nqx9wAkL8W08 ryVvKnoTloItUGX8ngrQqdGec9cD+q+9xdY2baRgTaVBgFzUL+XrVxvjeukM8vRCksXBR/As IvffS9pBo9+5dwEYHDv4w5IFPjUz5OjOVLJrHscUs8Z2ULZ7HsSMSUeGT4KkZmUUoUUm/uVm WZD7PLsWDrSRgKrhi1JUrXfDADfgUNsuUVDXOwfD1+CDA56Pog4e8zdgxgA+cXdPCbnAQ/aQ p7y9hMTlNoaOR7ziEr7LYfvILjgvEe86tX4AGFkixjVYW0Q+zbQ6CRa8I9PyU/6yDqbhJbbR v1lWNU3liqgQwmMVq+ceQHfUn01eBHKY64LnggsmaVWU7JenvHRsyYLF9JsGri/23GQi40pE J3I6p3SGLVN5FFkJV6W5m5ciA7RL+/8sVd2eh/gekGFDyAQFSiLfKqlHD2BdvsIqMV0YIYJU LkA3NIQ2O+Xmy6PN8duD1EslmhZz4SglFil66r8p6BCc7ZQ5IaOD+jYtbffsrAzwqIrxjB1I smrpf0WNhKszvpzY0eekJCVBHV+yQQ7hMPNnfog3eOYzZItenFydtREqwrB+CCmbQEwkXcXo ROY5YHefyEjctxxy8jcZeXPcI5Bhs9rQ84s3m3Yrn4BLcWZffxB/n5pmzqocxGkokxna2i2n W5JP --------------080406010206090905030707--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50BE6885.3000607>