What is Normalization in XML?
Can anyone please explain me what exactly is normalization with some simple example.Please explain all the things that are done in the process of Normalizing in XML?
Also about the java API in org.w3c.dom.Node public void normalize().What this method will do.Please explain clearly.
What is the use of normalizing ? What is the advantage of normalizing?
xml like this
<text>hello world!!!</text>
could be represented by a tree like this:
- Node: type=node, name=text
— Node: type=text, value=""
— Node: type=text, value="hello"
— Node: type=text, value=" "
— Node: type=text, value="world!!!"
— Node: type=text, value=""
or like this
- Node: type=node, name=text
— Node: type=text, value="hello world"
— Node: type=text, value="!!!"
or like this
- Node: type=node, name=text
— Node: type=text, value="hello world!!!"
and they all describe the same XML. now, the last example is normalized, the first two are not. A normalized node is such where there are no Text children with empty text (since they can be thrown away), and no adjacent Text chlidren (since they can be merged into one).
***
the reason it’s useful is that in normalized form, queries like
"get all nodes whose text is like "*ello worl*" will fail, but in normalized form, they’ll work
Normalization in XML or UML?
There is a big difference