473,549 Members | 2,751 Online
Bytes | Software Development & Data Engineering Community
+ 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="ht tp://www.w3.org/1999/xlink">
<Common id="pre">
<Param>AAAA</Param>
<Param>BBBB</Param>
</Common>

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

<xsl:styleshe et 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 2874
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****@h oehrmann.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
4013
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 to use any of these, or can any XML-aware software (parser/validator or xsl- enginge) use any of these?
1
2884
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? Thanks
2
1432
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
1260
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 attribute * xmllint allows elements to be accessed with full xpointer syntax, e.g. <xi:include href="authent.xml#xpointer(//connection)"
0
1199
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 scheme names to the W3C, but in the announcement of that Recommendation the W3C Director said: e expect to bring forward a proposal for...
1
1763
by: Daniel | last post by:
Microsoft support for XPointer and XLink what micrsoft technologies support XPointer and XLink?
0
1116
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" xpointer="xpointer(//NodeB)" /> FileC.xml
2
1876
by: Giacomino | last post by:
Let's suppose I want a document like this: <tree> <node> <nodeChildren> <node... </node> ... <nodeSelection selected="..."/> </node> ....
0
1525
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 ="xyz.xml#xpointer(//U) In my xslt file i am using
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
7524
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7451
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7720
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
6048
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5372
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5089
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3501
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3483
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1944
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 we have to send another system

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.