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

Re: Answers to review questions in "Beginning XSLT": C

Subject: Re: Answers to review questions in "Beginning XSLT": Chapter 10
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 21 Mar 2003 09:06:14 +0000
xml review answers
Hi Lars,

> 2. What format can the values of ID attributes take?
>
> Answer:
> They have to be XML Names, which means they must start with a
> letter, underscore, or colon, and contain only "alphanumeric"
> characters (which include '.' | '-' | '_' | ':' plus other similar
> punctuation in Unicode). In particular, no spaces are allowed.

There are a couple of things here. You say "plus other similar
punctuation in Unicode". Actually, XML names can only include the
punctuation characters you list: '.', '-', '_' and ':'. The ':'
character should not be used in IDs nowadays because the Namespaces in
XML Rec. stated that you should use NCNames instead of full XML Names.
NCNames (non-colonised names) can't contain a colon.

> 4. What three types of arguments can the id() function take and what
>    does it return from each?
>
> Answer:
> id() can take a string containing a single ID, in which case it returns
> the element that has that ID.
> id() can take a string containing multiple IDs separated by space, in
> which case it returns a node set consisting of the elements that have
> those IDs.
> id() can take a node set, in which case id() returns a node set
> consisting of the elements whose IDs are the values of nodes in the
> argument node set.

Yes, and if the nodes have values that are space-separated IDs, then
those get used.

> 7. Construct a stylesheet that groups <Film> elements by their <Year>
>    children and by their rating attributes.
>
> Answer:

That looks good (I assume it worked!). Another challenge is a
stylesheet that will group first by Year and then (within that) by
rating. [I think that's what I meant by the question, but I admit that
it's not worded clearly.]

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.