Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 18th, 2007, 02:54 AM
Registered User
 
Join Date: Dec 2007
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default using string as patterns in templates

hey All,

  I have a string variable containing an XML message. I would like to use the contents of this string variable as a pattern to match in a template (I would like to work on this string variable's contents as a nodeset). how would i do that?

Any help in this would be greatly appreciated.

Thanks in advance, Sudhish
 
Old December 18th, 2007, 05:08 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

You can't do this as part of standard XSLT.

Some XSLT processors provide extension methods which let you do this, such as Saxon's saxon:evaluate() function.
http://www.saxonica.com/documentatio.../evaluate.html

/- Sam Judson : Wrox Technical Editor -/
 
Old December 18th, 2007, 06:07 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You need to parse the string, to turn it from lexical XML into a tree of nodes. There's no standard way of doing it within XSLT. In Saxon you can call the saxon:parse() extension function; in other environments you could write your own extension function (for example in Javascript) to invoke the XML parser.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old December 18th, 2007, 07:22 AM
Registered User
 
Join Date: Dec 2007
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks a lot for your suggestions.

Regards,
Sudhish





Similar Threads
Thread Thread Starter Forum Replies Last Post
Design Patterns planoie General .NET 5 February 21st, 2007 01:56 PM
desgin patterns books Biergarten BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 November 23rd, 2006 07:18 PM
j2ee patterns Iszekeell Intro Programming 1 January 23rd, 2006 01:14 PM
Design Patterns Indian Ocean J2EE 0 September 25th, 2003 03:18 PM
DESIGN Patterns rahul1978 BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 3 August 31st, 2003 02:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.