Mark Fletcher wrote:

> *[conref] {
> 
> content: xpath("document(@conref)");
> 
> }


> I figured out my document() problem.  Somewhere along the way, I either
> moved my test conref'ed file or the working directory changed. Once I
> specified the full path to the file, I got it to work. Which leads to a
> question: how are paths in document() resolved? Is it relative to the
> source xml file? Or to the css file? Or something else?

I've checked both the spec http://www.w3.org/TR/xslt#document and our code.

When document() is used in a CSS, there is no base URL by default at
all. You need to specify one like this:

---
    *[conref] {
        content: xpath("document(@conref,.)");
    }
---

Now, having done this, if your conref attribute contains:

"foo.dita" ==> XXE works as expected.

"foo.dita#bar" ==> XXE works as expected.

"foo.dita#bar/gee" ==> the content is empty because there is no element
in foo.dita having ID attribute "bar/gee". (There is an element having
attribute id="gee" contained in topic with ID attribute "bar".)



---
PS: If you want the pulled text to wrap, simply specify:

---
    *[conref] {
        content: paragraph(xpath("document(@conref,.)"));
    }
---


Reply via email to