Types of XML
Entities
Help shorten and modularize XML documents
Provide markup for otherwise illegal characters
General entities
- Replaced by parser with a full string
- Examples: ©right; or &author;
Chapter 2 – 2 Proper XML Syntax
2-3 Valid documents
2-4 XML Namespaces
3. working with xml
4. manipulating xml with the dom
4-4 Bring it all together
5. XML and XPath
COPY THE CODE businesscard.xml TO https://www.freeformatter.com/xpath-tester.html
Joe Marini
(415) 555-4567 (800) 555-9876 (510) 555-1234 joe@joe.com
Xpath Query:
/BusinessCard/phone[last()]
Element='(510) 555-1234'
/BusinessCard/Name[contains(text(),’Joe’)]
Element='Joe Marini'
//phone[@type]
Element='(415) 555-4567' Element='(800) 555-9876'
//phone[@type=’work’]
Element='(800) 555-9876'
NOW COPY CODE items.xml TO THE TESTER
/items/item[type=’Coffee’]/photo
Element='photos/candles.jpg' Element='photos/teacup.jpg'
XML AND XSLT