XSLT TutorialLesson 64Free preview
XSLT Edit XML
This lesson is part of XML · All levels
Summary
XSLT not only changes the look, but it can also generate new XML so it's useful for modifying or adding XML data. By combining the element constructor and the <xsl:copy-of>, you can add, delete, or format a part of a document. On the server, the transformation results can be immediately reset as an XML file.
Key points
- XSLT converts one XML document into another, not just HTML.
- <xsl:copy> copying the current node; <xsl:copy-of> copying the node-set and its contents
- Elements that do not fit the template will be lost from the result, making it easy to "delete" the data
- New elements can be inserted directly as constructors in the template
- In PHP, the result can be stored with file_put_contents()
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.