Ticket #102 (new enhancement)
[PATCH] xi:include and fragments
| Reported by: | anonymous | Owned by: | cmlenz |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | Template processing | Version: | 0.3.6 |
| Keywords: | Cc: | martin.marcher@…, nicoe@… |
Description
At the moment it is not possible to use <xi:include href="somefile.html" /> to only get a certain subtag of the file.
I suggest something like:
input.html
<bookstore>
<books>
<book class="scifi">
<title>StarTrek</title>
<title>Babylon 5</title>
<title>The Blob</title>
</book>
<book class="technical">
We don't have any technical books yet
</book>
<book class="scifi" restriction="adult">
There are no books here yet
</book>
</books>
</bookstore>
- Using <xi:include /> NOTE: I don't know anything about the xi:include specs
<document> <xi:include href="input.html" xpath="//books[@class='scifi'] /> <document>
- Using <py:xpath path="..." />
<document> <py:xpath path="//books[@class='scifi']> <xi:include href="input.html" xpath="//books[@class='scifi'] /> </py:xpath> </document>
* Note the difference to py:match is that just the part inside py:xpath is processed and only matching attributes are placed multiple xpath matches could be defined like this: ` <py:xpath path="//book[@class='scifi'];//book[@class=]/@text" /> `
- Result
<document> <book class="scifi"> <title>StarTrek</title> <title>Babylon 5</title> <title>The Blob</title> </book> <book class="scifi"> There are no books here yet </book> </document>
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

