[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Signed Docbook Website Transformation
Hi Maria, Yes, XHTML is XML, according to the W3C which created both. But I'm still not clear on what the requirements are for storing this information in the XHTML. I think you have a <Signature> element with some content in your XML source, and you want the whole thing inside an XHTML comment in the output. You can achieve that with this with XSLT using a template like this: <xsl:template match="Signature"> <xsl:text disable-output-escaping="yes"><!--</xsl:text> <xsl:copy-of select="."/> <xsl:text disable-output-escaping="yes">--></xsl:text> </xsl:template> But that may not be a good solution. If your signature data contains a random sequence of characters like a hash code, then there is a good chance the XML parser will think some of it looks like XML syntax and generate an error. You may need to handle such content differently. Is it necessary to retain the element tags within the comment? Are there other ways to store this information in the XHTML? Often in XSLT when one thinks they need disable-output-escaping, some other solution would work better. For example, if you don't need the element tags, then you can use xsl:comment and put the data in text form inside the comment. Or perhaps you need to use a different namespace for the security information. Bob Stayton Sagehill Enterprises DocBook Consulting bobs@sagehill.net ----- Original Message ----- From: "maria jones" <jonesfamily2004@bellsouth.net> To: <docbook-apps@lists.oasis-open.org> Sent: Tuesday, September 28, 2004 9:16 PM Subject: Re: [docbook-apps] Signed Docbook Website Transformation > On Tuesday 28 September 2004 11:23, Bob Stayton wrote: > > I believe you need to add XSLT templates to your stylesheet customization > > layer to handle your extended elements. Do you have a specification of > > what the XHTML should look like for your new stuff? > > > > Bob Stayton > > Sagehill Enterprises > > DocBook Consulting > > bobs@sagehill.net > <snip> > I am attempting to build a kludge right now to do just that. ;) > > Bob, it's obvious that you are a Docbook guru; so let me ask you a question: > > Is XHTML technically considered XML(or compliant) by the appropriate standards > committee(s)? > > I am still learning XML and/or XSLT as i go so bare with me. Is this > possible/correct for the XML Security <Signature> element? > ... > <xsl:template match="Signature"> > <xsl:text disable-output-escaping="yes"><![CDATA[<!--]]></xsl:text> > <xsl:apply-templates xpointer="self::element()" /> > <xsl:text disable-output-escaping="yes"><![CDATA[-->]]></xsl:text> > </xsl:template> > ... > > Maybe <xsl:comment>? Is my xpointer path correct? > > I am "trying" to comment out the selected element. The problem is that as soon > as i do this the digital signature is then corrupted. Removal of the inserted > comments will return it to valid status. A pain for end-users, but it works. > > If I sign XHTML, then the source is valid. I am not sure how it looks in a > browser. Probably invalidates the XHTML as far as W3C is concerned. > > Ideas? Comments? TIA! > >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]