Download presentation
Presentation is loading. Please wait.
1
XNF: 1 XML and NNF A Standard Form for XML Documents (XNF) Properties –As few hierarchical trees as possible –No redundant data values in any tree Method –Model the application as a hypergraph of functional and multi-valued constraints. –Make the hypergraph canonical. –Transform the canonical hypergraph into an NNF scheme- tree forest with as few trees as possible. –Cast the NNF scheme trees into XML DTD / Schema.
2
XNF: 2 XNF Example Result: (RoomNr, RoomName, Cost, NrBeds, (View)*, (GuestNr, GuestName)* )* FD Closures: NrBeds: 4, Cost: 4, RoomNr: 3, RoomName: 3, GuestName: 2, View: 1, GuestNr: 1. Back off by one, when possible. NNF with as few schemes as possible:
3
XNF: 3 DTD (Document Type Definition) Defines a structure for XML documents Declarations –DOCTYPE –ELEMENT Structural elements in terms of regular expressions (, * + ? |) Elementary elements as Parsable Character DATA (#PCDATA) –ATTLIST
4
XNF: 4 Straightforward Translation Main Idea: Use the scheme-tree forest directly as the DTD specification. Details: –Introduce a root name (e.g. ). –Rename attributes appearing in multiple trees. –Add the scheme trees as structural elements (e.g. ). –Declare all attributes as elements with character data (e.g. ).
5
XNF: 5 Example (RoomNr, RoomName, Cost, NrBeds (View)* (GuestNr, GuestName)* )* <!DOCTYPE BandB [ <!ELEMENT BandB ( ( RoomNr, RoomName, Cost, NrBeds, (View)*, (GuestNr, GuestName)* )*)> … ]> 1 Kennedy 90 2 Forest Sea 101 Smith 2 …
6
XNF: 6 A More Sophisticated Translation Main Idea: Nest the XML according to the scheme- tree structure Details –Create concept names for each node (e.g. Rooms). –Identify key elements for nodes (e.g. RoomNr). –Nest according to node names and key elements (e.g. ). –Use XML attributes for key elements (e.g. ).
7
XNF: 7 Example Rooms: RoomNr, RoomName, Cost, NrBeds Views: ViewGuests: GuestNr, GuestName <!DOCTYPE BandB [ <!ELEMENT RoomNr (RoomName, Cost, NrBeds, Views, Guests)> ]> Kennedy 90 2 Smith … …
8
XNF: 8 A Translation to XML Schema XML Schema supersedes DTD’s –Adds data types –Adds keys and uniqueness constraints –Adds power to cardinality constraints –… Same basic idea as the sophisticated translation: use keys and nest according to the structure –Generate names automatically –Add cardinality and uniqueness constraints
9
XNF: 9 Example RoomNr, RoomName, Cost, NrBeds ViewGuestNr, GuestName <xs:element name=“RoomNr” minOccurs=“1” maxOccurs=“unbounded”> … … … <RoomNr RoomNr=“1” RoomName=“Kennedy” NrBeds=“2” Cost=“90”/> … (Full XML-Schema Instance)Full XML-Schema Instance
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.