4. XML schema refs,
XSLT
PB138
Homework
● Deadline is 1.4.2013 23:59
Schema Uniqueness and Keys
Must be inside !
...
xs:unique
Must be inside !
...
xs:key
xs:keyref
...
Difference between key and unique
● The selector for unique doesnt need to
contain the fields
Task
● Task1: Ensure the id is unique across
messages. Create attribute
"relatedMessage" which is a foreign key to
uniqueId
● Task2: Ensure that message IDs are unique
only across channels
XSLT
● messages.xml + messages.xslt = result.xml
● XSLT is composed of templates.
Running the Transformation
● Try transformation from Netbeans and from
Java
● HELLO WORLD
Basic Transformations
● / vs /messages
● Evaluation of the algorithm
○ apply-templates will again apply the whole template
file to each child
○ text() matching
● The implicit templates
○ We can override them!
Implicit Templates
Functional calling
● create a table "id, text"
○ sms text in red color
○ other text in blue
Modes, foreach and IFs
● Write out SMS first!
●
●
●
Other important concepts
● xsl:sort
● xsl:element
● xsl:call-template (with parameters)