150 likes | 281 Views
XLINK. A mechanism to link xml documents. Fujitsu’s free xlink processor. http://software.fujitsu.com/en/interstage-xwand/activity/xbrltools/xlip/index.html download exe file and sample application.
E N D
XLINK A mechanism to link xml documents
Fujitsu’s free xlink processor • http://software.fujitsu.com/en/interstage-xwand/activity/xbrltools/xlip/index.html • download exe file and sample application. • Note that at the time I downloaded the files the name of their sample application was NOT treedemo.jar but XLinkDemo.jar so the documentation is wrong in this regard.
From Fujitsu’s site • Let's get startedTo run this demo application, you need to take following steps. • install JDK 1.2.2(or later) in your computer, if you have not installed it. • download the software (which includes the demo application) from the download page • execute the demo application • double click "treedemo.jar" (Windows Users) • execute the following command (Others)> java -jar treedemo.jar • HOW TO START To browse an XML document, you need to take following steps. • press "open a file" button in the window of the application • select a file to open • press the "OK" button • Then you will see a tree root node of the document. You can see sub nodes of the root node by double clicking the root node. • HOW TO TRAVERSE This application clearly shows starting resources by changing the icon color of the node to red. Note that the icon color of the starting resource is always red whether the actuate attribute is "onRequest" or not. • There are two ways to start traversal. • select the starting resource and click the "traversal" button • place the mouse cursor on the starting resource and click your right mouse button
running treedemo (from Fujitsu site, continued) • PROCEDURES TO SELECT THE ENDING RESOURCE If you start simple link's traversal, the application directly jumps to the ending resource. Otherwise, following steps occurs. • If traversal starts, you will see the dialog which shows a list of arcs and radio buttons. You can start traversal from the list. The radio buttons indicate the type of show. • Then if you select one of the items in the list, select the show type and press the "traversal" button, you will see another dialog which shows the locators list which has information about each ending resource. • After you select one of the items in the list, the traversal action to the selected ending resource is actuated. • NOTE: Characters displayed in both lists indicate the value of the related title attribute. • NOTE: This simple procedure only exist to show the concept of XLink. It is easy to customize these actions more intuitively. • Pointer Addressing This application provides XPointer addressing functions. After browsing a XML documents, press "Search with XPointer...". Then you will see a dialog box which has one input field. Input XPointer syntax in the field and press "OK" button. You will see the addressing result as highlighting them.
C:\javaDir\bin>java XLinkDemo.jar(I moved the two xlink jar files to my java directory) • C:\PROGRA~1\JAVA\JDK15~1.0_0\BIN>java -jar XLinkDemo.jar
booklinks.dtd in notes • Examples from Deitel’s text chapt 14 in notes.
booklinks.xml in notes –I’ve copied some of the arc links onto this slide <arcElement xlink:type = "arc" xlink:from = "JavaBook" xlink:arcrole = "http://deitel.com/xlink/info" xlink:to = "authorDeitel" xlink:show = "new" xlink:actuate = "onRequest" xlink:title = "About the author"/> <arcElement xlink:type = "arc" xlink:from = "JavaBook" xlink:arcrole = "http://deitel.com/xlink/info" xlink:to = "publisherPrenticeHall" xlink:show = "new" xlink:actuate = "onRequest" xlink:title = "About the publisher"/> <arcElement xlink:type = "arc" xlink:from = "publisherPrenticeHall" xlink:arcrole = "http://deitel.com/xlink/stock" xlink:to = "warehouseXYZ" xlink:show = "embed" xlink:actuate = "onLoad" xlink:title = "Publisher's inventory"/>
Traversing an outbound link: Booklinks.xml (before pressing button)
DTD and XLink • Some details of namespace prefixes and so on can be hidden by providing a DTD for the XLinks.
A DTD for Booklinks <!-- Fig. 14.13 : booklinks.dtd --> <!-- DTD for extended Links --> <!ELEMENT books (author, publisher, warehouse, book, arcElement*)> <!ATTLIST books xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink" xlink:type (extended) #FIXED "extended" xlink:role CDATA #IMPLIED xlink:title CDATA #IMPLIED> <!ELEMENT book (#PCDATA)> <!ATTLIST book xlink:type (resource) #FIXED "resource" xlink:role CDATA #FIXED "http://deitel.com/xlink/book" xlink:title CDATA #IMPLIED xlink:label NMTOKEN #IMPLIED> <!ELEMENT author (persons)> <!ATTLIST author xlink:type (locator) #FIXED "locator" xlink:href CDATA #REQUIRED xlink:role CDATA #FIXED "http://deitel.com/xlink/author" xlink:title CDATA #IMPLIED xlink:label NMTOKEN #IMPLIED> <!ELEMENT publisher EMPTY> <!ATTLIST publisher xlink:type (locator) #FIXED "locator" xlink:href CDATA #REQUIRED xlink:role CDATA #FIXED "http://deitel.com/xlink/publisher" xlink:title CDATA #IMPLIED xlink:label NMTOKEN #IMPLIED>
DTD continued <!ELEMENT warehouse EMPTY> <!ATTLIST warehouse xlink:type (locator) #FIXED "locator" xlink:href CDATA #REQUIRED xlink:role CDATA #FIXED "http://deitel.com/xlink/warehouse" xlink:title CDATA #IMPLIED xlink:label NMTOKEN #IMPLIED> <!ELEMENT arcElement EMPTY> <!ATTLIST arcElement xlink:type (arc) #FIXED "arc" xlink:arcrole CDATA #IMPLIED xlink:title CDATA #IMPLIED xlink:from NMTOKEN #IMPLIED xlink:to NMTOKEN #IMPLIED xlink:show (new | replace | embed | other | none) #IMPLIED xlink:actuate (onLoad | onRequest | other | none) #IMPLIED> <!ELEMENT persons (person+)> <!ATTLIST persons id ID #REQUIRED> <!ELEMENT person (#PCDATA)>
XPointer and XInclude • These are not covered in the text but reference urls are provided: • www.w3.org.TR/xptr • www.w3.org.TR/xinclude