[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: searching for occurrences of unique string-value a
Am 05.06.2008 um 23:28 schrieb Julie:
Thank you for your reply, Michael. I don't know if that is possible. I'll give you my complete test case, which should work even with XMLSpy ;-) - Michael M|ller-Hillebrand XML === <?xml version="1.0" encoding="UTF-8"?> <PublicationContent> <File> <FileGuid>fileguid1</FileGuid> <FileShortDescription>Help 1</FileShortDescription> <ContentUnit> <CuMetadata> <BinaryType>no</BinaryType> <CuHistoryGuid>cuhistguid1</CuHistoryGuid> </CuMetadata> <CuContent> <Task> <RelatedLinks> <CuRef CuHistoryGuid="cuhistguid2">Related link text</CuRef> </RelatedLinks> </Task> </CuContent> </ContentUnit> </File> <File> <FileGuid>fileguid2</FileGuid> <FileShortDescription>Help 2</FileShortDescription> <ContentUnit> <CuMetadata> <BinaryType>no</BinaryType> <CuHistoryGuid>cuhistguid2</CuHistoryGuid> </CuMetadata> </ContentUnit> </File> </PublicationContent> XSLT ==== <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:key name="targetFile" match="File" use=".//CuHistoryGuid/text ()"/> <xsl:template match="RelatedLinks/CuRef"> <a class="old" href="{@CuHistoryGuid}.html"> <xsl:apply-templates/> </a> <a class="new" href="{key('targetFile', @CuHistoryGuid)/ FileGuid/text()}.html"> <xsl:apply-templates/> </a> </xsl:template>
</xsl:stylesheet> Result ====== <?xml version="1.0" encoding="UTF-8"?> <a class="old" href="cuhistguid2.html"/> <a class="new" href="fileguid2.html"/> -- _______________________________________________________________ Michael M|ller-Hillebrand: Dokumentations-Technologie Adobe Certified Expert, FrameMaker Lvsungen und Training, FrameScript, XML/XSL, Unicode <http://cap-studio.de/> -- Tel. +49 (9131) 28747
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|