I feel like I should know how to do this (and possibly I’ve previously been told how and have forgotten), but I’m at a loss.
I am implementing a process that gathers nodes from a single document (a DITA map) and constructs a system of maps where I’m using the maps primarily to represent a tree and enable lookup of things by key.
However, the order of the elements that make up these maps is also important (DITA’s rules for how you build DITA key spaces from maps depends entirely on document order).
For example, I have a map that maps “key names” to the elements that declare those key names, i.e.:
map { “key-01” : (<topicref keys=”key-01” href=”foo.dita”/>, <topicref keys=”key-01” href=”bar.dita”/>) }
This is the initial state of the map (reflecting pass 1 over the DITA map document) but then I need to add additional elements to the sequence that is the value of entry “key-01” and I need the resulting sequence to be in document order.
So my question: given two sequences of nodes from the same document, how does one construct a new sequence where the nodes are in document order?
Thanks,
Eliot
_____________________________________________
Eliot Kimber
Sr Staff Content Engineer
O: 512 554 9368
M: 512 554 9368
servicenow.com<https://www.servicenow.com>
LinkedIn<https://www.linkedin.com/company/servicenow> | Twitter<https://twitter.com/servicenow> | YouTube<https://www.youtube.com/user/servicenowinc> | Facebook<https://www.facebook.com/servicenow>
Hi,
I am trying to output XML with a link to a RelaxNG schema without success.
- It works with DTDs using doctype-public and doctype-systems in the
serialization params of file:write
- It works with .xsd because the declaration is in the attribute
- For relaxNg, the intro line looks like a PI, but I can't seem to be
able to keep PIs when outputting xml with file:write
Specifically:
let $map-params := map {
'method': 'xml',
'indent': 'no',
'omit-xml-declaration': 'no'
}
let $map := (
<?xml-model href="urn:oasis:names:tc:dita:rng:map.rng"
schematypens="http://relaxng.org/ns/structure/2.x"?>,
<map>
<?test name="abc"?>
<title>{lower-case($spez/child::*[name()='name']/text())}</title>{
<title>{lower-case($spez/child::*[name()='name']/text())}</title>{
...
}</map>
)
return
file:write($dir-path || '/spec-' ||
lower-case($spez/child::*[name()='name']/text()) || '.ditamap', $map)
gets me:
<map>
<title>Tests for elements - version 2.0</title>
...
</map>
Both the declaration and the in-content test pi disappear.
What am I missing here?
--
France Baril
Architecte documentaire / Documentation architect
france.baril(a)architextus.com