python - Doing an XSL transform of a branch of a Docbook element tree -


I want to use the DocBook XSL stylesheet so that different parts of a document can be rendered without completely changing .

The complexity is that in some of these parts, and lieutenant; FootnoteF> gtc: Elements whose links are not within the same segment In other words, I want to process a branch of a tree containing & lt; Footnoteref & gt; s but & lt; Footnote & gt; Elements not reference.

/ & lt; Ipython console & gt; In & lt; Module & gt; () / Var / www / mpd / & lt; Ipython console & gt; In & lt; Genexpr & gt; ((Elt,)) /usr/lib/python2.6/dist-packages/lxml/etree.so lxml.etree.XSLT.__ call__ (src / lxml / lxml.etree.c: 109204) () XSLTApplyError: Internal error in xsltKeyFunction (): Could not get document information of a reference document.

This happens in response to, e.g. etree.XSLT (etree.parse ('docbook.xsl')) (some_ediment) .

I am using the normal xhtml stylesheet. I will not expect which stylesheet I am using, though.

Is there a supported way of doing this? For example, before render it, & lt; Footnoteref & gt; element to & lt; Footnote & gt; to convert elements into an XSLT conversion to the document, or do I expect? But then it will not work, because then there are many and Lieutenant> gt; will be tagged if & lt; Footnote & gt; is not included in the tag, then it is only for that & lt; Footnoteref & gt; to Footnote & gt; will have to change as a result of which I expect to be happening already but hopefully I have forgotten one switch somewhere.

Edit

Thanks for the reply of Zuck, I thought I would like to submit that ID I can pass parameters to tell XSLT processors. However, it all produces very honestly, which refers to footnotes with the same piece which would be useful if the document is being provided as an HTML page. EG

  & gt; & Gt; & Gt; Xsl_url_html = 'http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl' & gt; & Gt; & Gt; From the Lxml Import Entry & gt; & Gt; & Gt; Consume_result = etree.XSLT (etree.parse (xsl_url_xhtml)) (etree.parse (my_xml_file), root = = etree.XSLT.strparam ("command_consume")) & Gt; & Gt; Etree.tostring (consume_result) .split ('\ n') ['  gt; & lt; meta http-equiv = "type content" content = "text / Html; Charset = ASCII "/> Title  gt; & lt; / head & gt; ; & Lt; body & gt; & lt; dt & gt; & lt; an id = "command_consume" & gt; & lt; / a & gt; & lt; span class = "word" & gt; ',' 

consume {& lt; em class = "replace" > Gt; state & lt; / code & gt; gt;} & lt; / p & gt; & lt; / div & gt; ',' & lt; / span & gt; & lt ; / Dt> 2 & lt ; / A & gt;] & lt; / sup & gt; state & lt; / code & gt;; ',' & lt; code class = "and Named "& gt; state should be 0 or 1. ',' \ t When the experiment is active, each song is removed from the playlist. ',' & Lt; / p & Gt; & lt; / dd & gt; & lt; / body & gt; & lt; / html & gt; ']

There is probably another parameter that allows photons to be the same Will inspire to display on the page, preferably counting 1? I think that this will probably happen somewhere. When I get some more time then I go through it.

DocBook XSL Stylesheet of a single element, you can apply it in full document, but that document You can specify the part of which you want to change with the parameter.

From the reference documentation:

The entire document will be loaded and parsed, but formatting will start with the identified element instead of the routing. For example, this allows you to process only Chapter 4 of any book.

Because the whole document is available for processor, automatic numbering, cross reference and other dependencies are resolved properly.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -