473,486 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

xlink and xpointer

Hello

I'm trying to learn xlink/xpointer (with no success so far :-(

I would like to produce the following output.

AAAA
BBBB
CCCC
AAAA
BBBB
DDDD

In the xlst I have tried changing the xsl:for-each to see if
I could figure out how to address the <test><Common><Param>
With no success.
Maybe the xlink I have done is wrong, or even what I like
to achieve is not possible at all.
The xml file I have is like this.

<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="testxlink.xslt"?>
<test xmlns:xlink="http://www.w3.org/1999/xlink">
<Common id="pre">
<Param>AAAA</Param>
<Param>BBBB</Param>
</Common>

<Element>
<common xlink:type="simple" xlink:href="#pre"/>
<Param>CCCC</Param>
</Element>
<Element>
<common xlink:type="simple" xlink:href="#pre"/>
<Param>DDDD</Param>
</Element>
</test>
The xslt
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<xsl:for-each select="test/Element">
<xsl:for-each select="Param">
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>


Feb 10 '07 #1
4 2860
If you want that output, you have to have logic that explicitly expands
the XLink -- either in something that processes your file before the
stylesheet sees it, or in the stylesheet itself. You haven't provided
the latter, and apparently nothing in your system is providing the former.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Feb 10 '07 #2
Joe Kesselman wrote:
If you want that output, you have to have logic that explicitly expands
the XLink -- either in something that processes your file before the
stylesheet sees it, or in the stylesheet itself. You haven't provided
the latter, and apparently nothing in your system is providing the former.
I see.

I was hoping the xslt processor should expand the xlink (automatically),
and then it was only a mather of seeing xml elements.
Is there any xslt processor who will do the expansion automatically.

/Martin
Feb 10 '07 #3
* Martin wrote in comp.text.xml:
>Is there any xslt processor who will do the expansion automatically.
No, for what you want XInclude http://www.w3.org/TR/xinclude/ is better
suited. If you want to do this in XSLT you could just use the substring-
after function to get the part after the # in the xlink:href and simply
find the corresponding element and apply any transformation to that, or
simply copy it using xsl:copy-of.
--
Björn Höhrmann · mailto:bj****@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
Feb 10 '07 #4
Bjoern Hoehrmann wrote:
* Martin wrote in comp.text.xml:
>>Is there any xslt processor who will do the expansion automatically.

No, for what you want XInclude http://www.w3.org/TR/xinclude/ is better
suited. If you want to do this in XSLT you could just use the substring-
after function to get the part after the # in the xlink:href and simply
find the corresponding element and apply any transformation to that, or
simply copy it using xsl:copy-of.
XInclude fantastic.

I rewrote the xml and now it works as I like.

many thanks
/Martin
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="testxlink.xslt"?>
<test xmlns:xi="http://www.w3.org/2001/XInclude">
<Common>
<Param>AAAA</Param>
<Param>BBBB</Param>
</Common>

<Element>
<xi:include href="#xpointer(//Common/Param)"/>
<Param>CCCC</Param>
</Element>
<Element>
<xi:include href="#xpointer(//Common/Param)"/>
<Param>DDDD</Param>
</Element>
</test>

Feb 11 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3998
by: DV | last post by:
Hello, can anyone tell me or point me to somewhere what the exact differences (in terms of when would I use what) between XPath, XLink, XPointer and DOM are? Does it require special software...
1
2882
by: a | last post by:
I'd like to associate (link elements in) a linkbase (xml) file with (elements in) an instance document (xml). I've never seen an example of how to do this. Anyone know how to do this in .NET? ...
2
1427
by: Pascal Schmitt | last post by:
Hello! Is there an Implementation of XPointer for .NET which supports range-to? (Or if not: how difficult is it to build it yourself?) -- Pascal Schmitt
0
1251
by: shaun | last post by:
Can anyone clarify if these are true and perhaps add to the list of XPointer supported parsers/transformers: For parsers: * Xerces will allow elements to be accessed if they have an xml:id...
0
1184
by: Henry S. Thompson | last post by:
W3C is pleased to announce the public launch of the XPointer Schemes Registry: http://www.w3.org/2005/04/xpointer-schemes/ The XPointer Recommendation reserved all simple (unprefixed) XPointer...
1
1756
by: Daniel | last post by:
Microsoft support for XPointer and XLink what micrsoft technologies support XPointer and XLink?
0
1104
by: moonty | last post by:
Is it possible to have a xpointer attribute inside a xml file called from a xinclude attribute. eg: FileA.xml <xi:include href="FileB.xml" /> FileB.xml <xi:include href="FileC.xml"...
2
1873
by: Giacomino | last post by:
Let's suppose I want a document like this: <tree> <node> <nodeChildren> <node... </node> ... <nodeSelection selected="..."/> </node> ....
0
1513
by: ab.angadbhat | last post by:
hi, I have an element in the xml file which has xlink:href ="xyz.xml" as an attribute. I am using xpointer to point to only 2nd <Uelement of the xyz.xml file and so i am doing:- xlink:href...
3
866
by: Robert Jones | last post by:
Is there a browser or even just a parser that fully supports and implements xlink and xpointer?
0
7099
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6964
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
7123
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,...
1
6842
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...
1
4864
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...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
262
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.