Poster at Kinetium dot Com wrote:
> I'm afraid I will display my ignorance here, but ... please point me at the
> appropriate part of the docs if I missed it there.
>
> 1) ------------
> If I have:
> <a>a1
> <b>name1
> <c>foo1</c>
> </b>
> <b>name2
> <c>foo2</c>
> </b>
> </a>
> <a>a2
> <b>name2
> </b>
> </a>
>
> What stylesheet will let me see just the <a> elements with their text
> appended with the first text node of the first <b>element (with <b> and <c>
> elements totally hidden e.g. display: none).
>
> i.e. display
>
> a1: name1
> a2: name2
---
root {
display: block;
}
a {
display: block;
}
a:after {
display: inline;
content: ": " xpath("./b[1]/text()[1]");
color: gray;
}
b,
c {
display: none;
}
---
> 2) ------------
> How can I make this collapsed display appear only when the <a> elements are
> "collapsed"?
---
root {
display: block;
}
a {
display: block;
margin-left: 4ex;
collapsible: yes;
collapsed-content:
xpath("concat(./text()[1], ': ', ./b[1]/text()[1])");
}
a:before {
display: marker;
content: collapser();
}
b {
color: maroon;
display: block;
}
c {
color: navy;
}
---
This is currently the best XXE can do.
Attached samples can be used to test this directly with XXE. You can
switch from first style sheet to the second one using XXE's Style menu.
All this is documented in
http://www.xmlmind.com/xmleditor/_distrib/docs/csssupport/index.html and
in the XPath 1.0 recommendation, which of course, does not mean that it
is simple to find out how to do it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample.xml
Type: text/xml
Size: 316 bytes
Desc: not available
Url :
http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20040518/4050cbae/attachment.xml
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample2.css
Type: text/css
Size: 308 bytes
Desc: not available
Url :
http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20040518/4050cbae/attachment.css
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample.css
Type: text/css
Size: 181 bytes
Desc: not available
Url :
http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20040518/4050cbae/attachment-0001.css