Hi Thanks for the help!

However, I tried both versions of this xpath expression: 

xpath("//tit...@target = substring-after(current()/@href, '#')]")

And

xpath("//tit...@target = substring-after(@href, '#')]")

In this css code:
CrossReference {
        color: blue;
        text-decoration: underline;
        content: icon(left-link) xpath("//tit...@target = 
substring-after(@href, '#')]")  ;

    vertical-align: text-top; 
    color: navy;
}

All I get is the link icon and nothing else.

Is there something else I can try?

Thanks again!


Russ

-----Original Message-----
From: Hussein Shafie [mailto:[email protected]] 
Sent: Friday, October 23, 2009 2:00 AM
To: Urquhart, Russ
Cc: xmleditor-support at xmlmind.com
Subject: Re: [XXE] css xpath question

Urquhart, Russ wrote:
>  
> we have xml like the following:
>  
> <CrossReference href="#SWCU057-3223"/> shows the AV connector, and 
> <CrossReference href="#SWCU057-3427"/>  describes the signal for the 
> AV connector (see the <Emphasis type="italic"> AV HW IF Specification 
> For Vendors, version 3.0</Emphasis>).
> </Para>
> <Title Target="SWCU057-3223" numeration="decimal" role="Figure">AV 
> Connector Pin Layout</Title>
>  
> In the editor via the css file, i want the CrossReference to show as a 
> link and have the title of whats pointed to by the href attribute, 
> minus the initial '#'.
>  
> So in my css i have:
>  
> CrossReference {
>  color: blue;
>  text-decoration: underline;
>      content: icon(left-link) xpath("*/tit...@target = 
> substring-after(@href, '#')]  ") ;
>  
>     vertical-align: text-top;
>     color: navy;
> }
>  
> And i dont get anything. However, when i put, for the content line:
>  
>    content: icon(left-link) xpath("substring-after(@href, '#")")
>  
> I at least get the correct Target value.
>  
> I'm sure this is a newbie Xpath question, but any help is GREATLY 
> appreciated!
>  

In the context of a CrossReference element, "*/Title" means: the Title elements 
which are the grand children of this CrossReference element. I don't think that 
this is what you want to specify.

Instead try "//Title" which means: any Title element which is found in the 
document:

---
xpath("//tit...@target = substring-after(current()/@href, '#')]")
---

Also note the "current()/@href" subexpression. Without "current()/", the 
expression means: any Title having a Target attribute equals to the fragment of 
its href attribute.

References:

* XML Path Language (XPath) Version 1.0 -- http://www.w3.org/TR/xpath

* XSL Transformations (XSLT) Version 1.0, Miscellaneous Additional Functions -- 
http://www.w3.org/TR/xslt#misc-func, for current().

* XMLmind XML Editor - Commands, XPath functions -- 
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/xpathfunc.html




Reply via email to