473,401 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

xslt document fucntion

2
I am attempting to use the XSLT document function to extract the value of an attribute in a secondary XML file. In order to add an image to the generatedHTML

Both xml files I am dealing with are generated from MS Word 2007

here is the relevant XSLT snippet:
Expand|Select|Wrap|Line Numbers
  1. <xsl:template match="w:drawing[ancestor::w:p/w:r]">
  2.     <img>
  3.         <xsl:attribute name="src">
  4.         <xsl:value-of select="document('agenda/word/_rels/document.xml.rels')/Relationships/Relationship[@id='rId102']"/>
  5.         </xsl:attribute>
  6.         <xsl:apply-templates />
  7.     </img>
  8. </xsl:template>
and here is a few lins from the document.xml.rels:

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 
  2. <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
  3.   <Relationship Id="rId26" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header" Target="header12.xml" /> 
  4.   <Relationship Id="rId117" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer" Target="footer56.xml" /> 
  5.   <Relationship Id="rId21" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer" Target="footer5.xml" /> 
  6.   <Relationship Id="rId42" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer" Target="footer19.xml" /> 
  7.   <Relationship Id="rId47" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer" Target="footer23.xml" /> 
  8.   <Relationship Id="rId63" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer" Target="footer32.xml" /> 
  9.   <Relationship Id="rId68" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header" Target="header27.xml" /> 
  10.   <Relationship Id="rId84" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer" Target="footer45.xml" /> 
  11.   <Relationship Id="rId89" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header" Target="header36.xml" /> 
  12.   <Relationship Id="'rId102" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="media/image11.jpeg" />
  13. </Relationships> 
any thoughts much appreciated
Dec 20 '07 #1
2 2247
jkmyoung
2,057 Expert 2GB
Looks like a namespace problem:
Add the namespace to the stylesheet node
xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"

Then use it:
Expand|Select|Wrap|Line Numbers
  1. <xsl:value-of select="document('agenda/word/_rels/document.xml.rels')/rel:Relationships/rel:Relationship[@id='rId102']"/>
  2.  
Dec 20 '07 #2
mdawg
2
ah yes, didn't look at your original query well enough. You want the Target attribute node at this element node.

Expand|Select|Wrap|Line Numbers
  1. select="document('agenda/word/_rels/document.xml.rels')/rel:Relationships/rel:Relationship[@id='rId102']/@Target"
  2.  
Dec 20 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Victor | last post by:
Hi, this might sound silly but I cannot figure out how to incorporate some XML of employees into some XML of a company to give new XML containing them all. For example, this is the company now ...
4
by: schneider | last post by:
Anyone know if there is a way to dynamicly create a Xslt template/s and use them as an xml transform with-out use files for the Xslt? All the methods I see use files. I want to create a Xslt...
2
by: Knighterrant | last post by:
How to combine multiple xml files into a single one, or split an xml file into multiple files using xslt?
3
by: thomas.porschberg | last post by:
Hi, I want to read records from a database and export it in an arbitrary format. My idea was to feed a class with a String array fetched from the database and let this class fire SAX events as...
1
by: Rajesh | last post by:
I am trying to pass the namespace, which is in my Original Message, to a Java method for further processing. In the original message the xmlns:xenc namespace is present. I make a call to Java...
1
by: Sergey Dubinets | last post by:
In effort to prioritize our goals we composed the list of random features each of them may add value to set of XSLT tools offered from Microsoft. 1. XSLTc (Compiler for XSLT...
12
by: Chris | last post by:
Hi, Just wondering if anyone out there knows if it is possible to convert a CSV to xml using XSLT? I've seen a lot of examples of xml to CSV, but is it possible to go back the other way? I...
3
by: super.raddish | last post by:
Greetings, I am relatively new to, what I would call, advanced XSLT/XPath and I am after some advice from those in the know. I am attempting to figure out a mechanism within XSLT to compare the...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.