Join David Gassner for an in-depth discussion in this video Wrapping text in CDATA sections with JDOM, part of Java: XML Integration.
A C data section is used to wrap text, that can contain reserved…characters, that might otherwise be turned into what are known as Entities, in XML.…These include Ampersands, quotes, and some other characters.…Here's how you can wrap text inside a C data section, using JDOM.…The coding style is pretty much the same, and I'll demonstrate…it with the about child element, of my customer data set.…Right now, I'm creating an about child element and passing…in the raw text value, and that's creating a text node.…
And if that text contains these reserved characters, it might cause some issues.…So, when I first create the element, I'll pass in a blank string instead.…I'm also going to change the code, so I can…get a reference to the element, that's just been created.…I'll come down to addChildElement and I'll…change the return type, from void, to element.…And at the end of the code, I'll return the ChildElement.…Now, I'll come back to the code, where I'm creating the aboutChildElement, and I'll…get a reference to the element that's just been created, that I'll name, About.…
Author
Released
11/8/2013- Choosing a Java-based XML API
- Reading XML as a string
- Comparing streaming and tree-based APIs
- Parsing XML with SAX
- Creating and reading XML with DOM
- Adding data to an XML document with JDOM
- Reading and writing XML with StAX
- Working with JAXB and annotated classes
- Comparing Simple XML Serialization to JAXB
Skill Level Intermediate
Duration
Views
Related Courses
-
Advanced Java Programming
with David Gassner3h 33m Advanced
-
Introduction
-
Welcome55s
-
What you should know1m 43s
-
Using the exercise files4m 48s
-
-
1. Getting Started
-
Reviewing XML terminology9m 56s
-
Reading XML as a string5m 42s
-
-
2. Parsing XML with SAX (Simple API for XML)
-
How SAX works6m 7s
-
-
3. Creating and Parsing XML with Document Object Model
-
How DOM works7m 56s
-
Creating a DOM document8m 5s
-
-
4. Creating and Parsing XML with JDOM
-
How JDOM works5m 52s
-
-
5. Creating and Parsing XML with StAX
-
How StAX works6m 11s
-
-
6. Creating and Parsing XML with JAXB
-
7. Creating and Parsing with Simple XML Serialization
-
Comparing Simple to JAXB3m 59s
-
-
Conclusion
-
Next steps1m 7s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Wrapping text in CDATA sections with JDOM