[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Predicates question

Subject: Predicates question
From: Roelof Wobben <rwobben@xxxxxxxxxxx>
Date: Sat, 17 Dec 2011 13:39:15 +0000
 Predicates question
I have this small xml file :

<?xml version="1.0" encoding="ISO-8859-1"?>

   <title lang="eng">Harry Potter</title>

   <title lang="eng">Learning XML</title>


And now I want to show only a few books.

According to this page : http://www.w3schools.com/xpath/xpath_syntax.asp I can
use this xslt :

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
 <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

<xsl:template match="/">
   <xsl:apply-templates select="/bookstore/book[position()<3]" />

<xsl:template match="bookstore/book">
   <h1><xsl:value-of select="title"</h1>
   <xsl:value-of select="price"


But if I try this on xmlspy I get this message :

Character '<' is grammatically unexpected
 Reason: one of the following is expected (see below)
  XML production: Production 'AttValue' not satisfied

What part did I misunderstood.


Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.