I have to write xslt to wordml (2007) documents. There are hyperlinks like below.
< w:p w:rsidR="00FD086A" w:rsidRDefault="00425A76" w:rsidP="00FD086A">
< w: hyperlink r:id="rId4" w:history="1">
< w:r w:rsidR="00FD086A" w:rsidRPr="00425A76">
< w:rPr>
< w:rStyle w:val="Hyperlink"/>
< /w:rPr>
< w:t>google</w:t>
< /w:r>
< /w:hyperlink>
< /w:p>
I want to get the url for the link name. In here I want to get the url for the “google” link. I know its there in Relationships, but I can’t access that with xslt. Does anybody know? (Probably writing a template?) please help me!
Assuming that the following namespace prefixes are declared:
the following XPath can be used to select the value of the URL using the value of the
w:hyperlink/@r:id(hard-coded value of “rId5” in this example):You could use it in the context of a template matching on the
w:hyperlinkto produce an HTML anchor element, like this: