Hi Hussein,

Thanks for the tip about using the dot as the second parameter of the
document() function! That solved my relative path problem.  FWIW, I
can't get document() to work if there is a hash mark in the url. So I
use this instead:

        document((substring-before(@conref,'#'),.)

Not sure if this is as documented or not. But it's certainly an easy
enough workaround.


I have another question about your xpath interpretation. I'm getting two
different results with two similar implementations.

This xpath returns the result of the expression to the left of the pipe:

        xpath("ancestor::reltable|document(@href,.)//shortdesc")

But this xpath never returns the result of the expression to the left of
the pipe:

        
xpath("ancestor::reltable|document(substring-before(@href,'#'),.)//*...@id
=substring-after(current()/@href,'#')]/shortdesc")

In fact, the left-hand expression returns false even if I do this:

        
xpath(".|document(substring-before(@href,'#'),.)//*...@id=substring-after(
current()/@href,'#')]/shortdesc")


Is there something about my right-hand expression that's causing this?
I've tried grouping in parentheses to make the logical distinction
clearer, but it doesn't help.


On a totally unrelated topic... Is it possible to deploy XXE as a
browser-based editor? We've been looking into using Xopus or Altova
Authentic to provide a simple editor interface for the browser view of
our CMS (Alfresco). I had been assuming that XXE couldn't serve this
purpose, but perhaps it can?


Thanks,

Mark



-----Original Message-----
From: Hussein Shafie [mailto:[email protected]] 
Sent: Friday, March 17, 2006 7:10 AM
To: Mark Fletcher
Cc: xmleditor-support at xmlmind.com
Subject: Re: DITA configuration (Was: me again)

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