XSLT

1,020 views

Published on

XSLT

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,020
On SlideShare
0
From Embeds
0
Number of Embeds
55
Actions
Shares
0
Downloads
51
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

XSLT

  1. 1. <?xml version=„1.0‟ encoding=“UTF-8”?> <html><HumanResource> <head> <title>Human Resource</title> <Person id=„1‟ salary=“500”> </head> <Name> <body> <FirstName>John</FirstName> <p>Joe‟s company have 1 workers</P> <MidName></MidName> <hr/> <LastName>Doe</LastName> <p>Detail information:</p> </Name> <p>Name: John doe</p> <Position>Manager</Position> <p>Position: Manager</p> </Person> </body> </html></HumanResource>
  2. 2. <?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/REC-html40"> <xsl:output method="html"/> • root node <xsl:template match="/"> • xsl:stylesheet or xsl:transform <html> <head><title>Human Resource</title></head> • specific output <body><p>Joes company have <xsl:value-of select="count(HumanResource/Person)" /> workers</p> <p>Detail information:</p> <hr/> <xsl:apply-templates select="/HumanResource/Person" /> </body> • match root element </html> • call function • main function </xsl:template> • have only one main function <xsl:template match="Person"> • a function <p>Name: <xsl:value-of select="string(Name)" /></p> <p>Position: <xsl:value-of select="Position" /></p> </xsl:template></xsl:stylesheet> • a built-in function
  3. 3. literal result XSLTcode
  4. 4. Order by import precedenceOrder by priority
  5. 5. Import B (5) D (6)Import E (4)Import A (1) Import Import F (3) C (2)

×