SlideShare a Scribd company logo
1 of 25
Download to read offline
in 37 minutes

                            Episode 4
                       Taking advantage of
                    XMetaL’s XInclude support



                   Tom Magliery, XML Technology Specialist




Brought to you by XMetaL Technical Services                  © 2010 JustSystems Inc.
Announcements
 • Next time: Su-Laine “XMetaL for Simple XML
   Editing
   Editing”




                                           © 2010 JustSystems Inc.
Agenda
 • Introduction
 • B i XI l d markup
   Basic XInclude   k
 • XMetaL XInclude APIs




                          © 2010 JustSystems Inc.
What is XInclude
 •   W3C XML standard
 •   General purpose inclusion mechanism
     G       l        i l i        h i
 •   Including XML inside other XML
 •   A general way to achieve content reuse




                                              © 2010 JustSystems Inc.
XMetaL’s XInclude support
 • XMetaL automatically recognizes XInclude
   markup
 • XMetaL XInclude APIs allow customizers to add
   reuse functionality to document customizations




                                              © 2010 JustSystems Inc.
Getting started
 • Step 1: Define XInclude elements in your
   DTD/schema

 • St 2: Put XInclude markup in your instance
   Step 2 P t XI l d     k i         i t
   document

 • Step 3: See what happens in XMetaL
 • ...



                                              © 2010 JustSystems Inc.
STEP 1: XINCLUDE IN YOUR
DTD OR SCHEMA


                           © 2010 JustSystems Inc.
XInclude specifies two new elements
 • <xi:include>
   – Pl
     Placeholder f referenced content
          h ld for f          d    t t
   – Pointer to referenced content
   – Put wherever you want to be able to include things
 • <xi:fallback>
   – Content to be displayed if XInclude resolution fails




                                                        © 2010 JustSystems Inc.
Example DTD with XInclude
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- "-//Mag//DTD Simple Paper//EN" -->
 <!ELEMENT Paper (
             p   (Title, Author, (
                       ,       , (Section | xi:include)*) >
                                                      ) )
 <!ELEMENT Title (#PCDATA) >
 <!ELEMENT Author (#PCDATA) >
 <!ELEMENT Section (Title, (Para | Blockquote | xi:include)*) >
 <!ELEMENT Para (#PCDATA | Bold | Italic)* >
 <!ELEMENT Blockquote (#PCDATA | Bold | Italic)* >
 <!ELEMENT Bold (#PCDATA) >
 <!ELEMENT Italic (#PCDATA) >

 <!ELEMENT xi:include (xi:fallback?)>
 <!ATTLIST xi:include
     xmlns:xi         CDATA      #FIXED     "http://www w3 org/2001/XInclude"
                                             http://www.w3.org/2001/XInclude
     href             CDATA      #IMPLIED
     parse            (xml|text) "xml"
     xpointer         CDATA      #IMPLIED
     encoding         CDATA      #IMPLIED
     accept
         p            CDATA      #IMPLIED
     accept-language CDATA       #IMPLIED
 >

 <!ELEMENT xi:fallback (#PCDATA|Para)*>
 <!ATTLIST xi:fallback
     xmlns:xi
       l    i        CDATA       #
                                 #FIXED     "http://www.w3.org/2001/XInclude"
                                             h    //     3    /2001/    l d
 >



                                                                                © 2010 JustSystems Inc.
STEP 2: XINCLUDE IN YOUR
DOCUMENT MARKUP


                           © 2010 JustSystems Inc.
XInclude markup


 <xi:include h f "
    i i l d href="my_other_paper.xml"
                       th           l"
        xpointer="xpointer(/Paper/Section)">
        <xi:fallback>This is fallback text.</xi:fallback>
 </xi:include>
  /




                                                      © 2010 JustSystems Inc.
Sample document

 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE Paper PUBLIC "-//Mag//DTD Simple Paper//EN"
 "simplepaper.dtd">
 <Paper>
 <Title>This is my Paper</Title>
 <Author>John Q. Public</Author>
 <Section>
         <Title>First section</Title>
         <Para>First paragraph.</Para>
         <Para>Second paragraph.</Para>
 </Section>
 <xi:include href="my_other_paper.xml"
         xpointer="xpointer(/Paper/Section[1])">
 <xi:fallback>This is fallback text.</xi:fallback>
 </xi:include>
 </Paper>




                                                         © 2010 JustSystems Inc.
STEP 3: SEE WHAT HAPPENS
IN XMETAL


                       © 2010 JustSystems Inc.
STEP 4: DO STUFF WITH
SCRIPT


                        © 2010 JustSystems Inc.
Implementing XML inclusions
 • XMetaL automatically recognizes XInclude
   markup
 • But there is no built-in user interface
 • Th
   There are new API
                   APIs
    – XInclude-related methods/properties on Document
      and Application objects
 • Write script using APIs to implement desired
   functionality
               y




                                                   © 2010 JustSystems Inc.
Bonus tip: Pasting script
 • (Not related to XML inclusions)
 • C paste executable script code i t th
   Can      t       t bl     i t d into the
   XMetaL main document window
 • R
   Requires specific script h d li
       i        ifi     i t header line:

    //XMetaL Script Language JScript:
    ActiveDocument.Host.Alert("Hello, world");




                                                 © 2010 JustSystems Inc.
ShowXInclude(node)
ShowXInclude(node)
 • Document object method
 • If node i an XI l d the t
        d is     XInclude, th target is displayed
                                   t i di l     d
 • Else, if node has XInclude ancestor(s), the
   nearest one is di l
           t     i displayed
                           d
 • Else, if node has XInclude descendants, they
   are all displayed
   – ShowXInclude(ActiveDocument.documentElement)
     will show a inclusions in the docu e
          s o all c us o s       e document
 • NOTE: An XInclude must be updated at least
   once before it can be displayed
                            p y

                                                © 2010 JustSystems Inc.
UpdateXInclude(node)
UpdateXInclude(node)
 •   Document object method
 •   Same rules about which node(s) are affected
     S       l    b t hi h d ( )             ff t d
 •   Causes a “refresh” of the affected node(s)
 •   Does not change visibility of the included
     content




                                                  © 2010 JustSystems Inc.
HideXInclude(node)
HideXInclude(node)
 •   Document object method
 •   Same rules about which node(s) are affected
     S        l   b t hi h d ( )            ff t d
 •   Hides the target content of affected nodes
 •   Display reverts to fallback content




                                                 © 2010 JustSystems Inc.
OpenXIncludeTarget(node)
OpenXIncludeTarget(node)
 • Document object method
 • If node i an XI l d opens the t
        d is    XInclude,    th target
                                     t
   document (specified in href)
 • El if node h XI l d ancestor(s), opens
   Else,      d has XInclude       t ( )
   the target document of the nearest one




                                         © 2010 JustSystems Inc.
Some other interesting APIs
 • ExportWithXIncludesToFile(strFile)
 • E
   ExportWithXIncludesToXML()
        tWithXI l d T XML()
   – Returns an XML string
 • Li kR l ti E Li t
   LinkResolutionErrorList
   – Property, returns ValidationErrorList object
 • ResultsManager object
   – Application.ResultsManager.ShowLinkLogTab()
   – Application ResultsManager HideLinkLogTab()
     Application.ResultsManager.HideLinkLogTab()




                                                    © 2010 JustSystems Inc.
Documentation
 • Full documentation on the XML inclusion APIs is
   in XMetaL Developer 6.0 docs
                       60




                                              © 2010 JustSystems Inc.
Some possible functionality
 • Menu commands:
   –IInsert XML inclusions
          t     i l i
   – Show or hide all inclusions
 • Context menu commands:
   – Hide or show one XML inclusion
   – Open XML inclusion target
 • Other
   – Combine with “Treat as link AI button
                   Treat    link”
   – Custom dialogs



                                             © 2010 JustSystems Inc.
DocBook sample
    • Included* with XMetaL 6.0
    • Ill t t several XI l d f t
      Illustrates     l XInclude features
    • (DEMO)




* No pun intended                           © 2010 JustSystems Inc.
Resources
 • XMetaL Community Forums
   – htt //f
     http://forums.xmetal.com/
                      t l    /
 • JustSystems Partner Center
   – http://justpartnercenter com/
     http://justpartnercenter.com/
 • Ask us for help (partner tech support)
   – partnersupport na@justsystems com
     partnersupport-na@justsystems.com




                                            © 2010 JustSystems Inc.

More Related Content

Viewers also liked

Molly Cate & Kristen Hayner - The E Campaign, 1/9/08
Molly Cate & Kristen Hayner - The E Campaign, 1/9/08Molly Cate & Kristen Hayner - The E Campaign, 1/9/08
Molly Cate & Kristen Hayner - The E Campaign, 1/9/08NAMA
 
Tom Cigarran - Healthways Presentation
Tom Cigarran - Healthways PresentationTom Cigarran - Healthways Presentation
Tom Cigarran - Healthways PresentationNAMA
 
Getting Kids on Track for College
Getting Kids on Track for CollegeGetting Kids on Track for College
Getting Kids on Track for CollegeJeremy Zweiacker
 
Why does this Survey Cost so Damn Much?
Why does this Survey Cost so Damn Much?Why does this Survey Cost so Damn Much?
Why does this Survey Cost so Damn Much?DaveCoffey
 
Web 2.0 and a Changing World
Web 2.0 and a Changing WorldWeb 2.0 and a Changing World
Web 2.0 and a Changing WorldMichael Coghlan
 
Bibliografie societate si comunicare de masa
Bibliografie societate si comunicare de masaBibliografie societate si comunicare de masa
Bibliografie societate si comunicare de masaMela Gadalean
 

Viewers also liked (10)

Alt c presentation
Alt c presentationAlt c presentation
Alt c presentation
 
Molly Cate & Kristen Hayner - The E Campaign, 1/9/08
Molly Cate & Kristen Hayner - The E Campaign, 1/9/08Molly Cate & Kristen Hayner - The E Campaign, 1/9/08
Molly Cate & Kristen Hayner - The E Campaign, 1/9/08
 
Tom Cigarran - Healthways Presentation
Tom Cigarran - Healthways PresentationTom Cigarran - Healthways Presentation
Tom Cigarran - Healthways Presentation
 
Russian mobile VAS market in 2Q2010
Russian mobile VAS market in 2Q2010Russian mobile VAS market in 2Q2010
Russian mobile VAS market in 2Q2010
 
Getting Kids on Track for College
Getting Kids on Track for CollegeGetting Kids on Track for College
Getting Kids on Track for College
 
Chapter 15 and 16
Chapter 15 and 16Chapter 15 and 16
Chapter 15 and 16
 
Section16
Section16Section16
Section16
 
Why does this Survey Cost so Damn Much?
Why does this Survey Cost so Damn Much?Why does this Survey Cost so Damn Much?
Why does this Survey Cost so Damn Much?
 
Web 2.0 and a Changing World
Web 2.0 and a Changing WorldWeb 2.0 and a Changing World
Web 2.0 and a Changing World
 
Bibliografie societate si comunicare de masa
Bibliografie societate si comunicare de masaBibliografie societate si comunicare de masa
Bibliografie societate si comunicare de masa
 

Similar to Taking Advantage of XMetaL’s XInclude Support

IPTC News in JSON November 2017
IPTC News in JSON November 2017IPTC News in JSON November 2017
IPTC News in JSON November 2017Stuart Myles
 
Jdom how it works & how it opened the java process
Jdom how it works & how it opened the java processJdom how it works & how it opened the java process
Jdom how it works & how it opened the java processHicham QAISSI
 
TYPO3 Transition Tool
TYPO3 Transition ToolTYPO3 Transition Tool
TYPO3 Transition Toolcrus0e
 
XML Prague 2005 EXSLT
XML Prague 2005 EXSLTXML Prague 2005 EXSLT
XML Prague 2005 EXSLTjimfuller2009
 
Splunk Modular Inputs / JMS Messaging Module Input
Splunk Modular Inputs / JMS Messaging Module InputSplunk Modular Inputs / JMS Messaging Module Input
Splunk Modular Inputs / JMS Messaging Module InputDamien Dallimore
 
Balisage - EXPath - A practical introduction
Balisage - EXPath - A practical introductionBalisage - EXPath - A practical introduction
Balisage - EXPath - A practical introductionFlorent Georges
 
XML Document Object Model (DOM)
XML Document Object Model (DOM)XML Document Object Model (DOM)
XML Document Object Model (DOM)BOSS Webtech
 
IPTC News Exchange Formats Working Party Autumn 2012
IPTC News Exchange Formats Working Party Autumn 2012IPTC News Exchange Formats Working Party Autumn 2012
IPTC News Exchange Formats Working Party Autumn 2012Stuart Myles
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object ModelWebStackAcademy
 
Shindig in 2 hours
Shindig in 2 hoursShindig in 2 hours
Shindig in 2 hourshanhvi
 
Zentyal Customization (templates, hooks, LDAP)
Zentyal Customization (templates, hooks, LDAP)Zentyal Customization (templates, hooks, LDAP)
Zentyal Customization (templates, hooks, LDAP)Carlos Pérez-Aradros
 
Ikenna Okpala: London Java Community: Wicket and Scala - 27/07/2010.
Ikenna Okpala: London Java Community: Wicket and Scala - 27/07/2010.Ikenna Okpala: London Java Community: Wicket and Scala - 27/07/2010.
Ikenna Okpala: London Java Community: Wicket and Scala - 27/07/2010.Skills Matter
 
Short Lightening Talk
Short Lightening TalkShort Lightening Talk
Short Lightening TalkIkenna Okpala
 
OCCIware, a formal framework for Everything as a Service. OW2con'15, November...
OCCIware, a formal framework for Everything as a Service. OW2con'15, November...OCCIware, a formal framework for Everything as a Service. OW2con'15, November...
OCCIware, a formal framework for Everything as a Service. OW2con'15, November...OW2
 
OCCIware, a formal framework for Everything as a Service. OW2con'15, November...
OCCIware, a formal framework for Everything as a Service. OW2con'15, November...OCCIware, a formal framework for Everything as a Service. OW2con'15, November...
OCCIware, a formal framework for Everything as a Service. OW2con'15, November...OCCIware
 
DotNetNuke – CMS redefined
DotNetNuke – CMS redefinedDotNetNuke – CMS redefined
DotNetNuke – CMS redefinedCharles Nurse
 

Similar to Taking Advantage of XMetaL’s XInclude Support (20)

IPTC News in JSON November 2017
IPTC News in JSON November 2017IPTC News in JSON November 2017
IPTC News in JSON November 2017
 
XML Pipelines
XML PipelinesXML Pipelines
XML Pipelines
 
Jdom how it works & how it opened the java process
Jdom how it works & how it opened the java processJdom how it works & how it opened the java process
Jdom how it works & how it opened the java process
 
TYPO3 Transition Tool
TYPO3 Transition ToolTYPO3 Transition Tool
TYPO3 Transition Tool
 
XML Prague 2005 EXSLT
XML Prague 2005 EXSLTXML Prague 2005 EXSLT
XML Prague 2005 EXSLT
 
Splunk Modular Inputs / JMS Messaging Module Input
Splunk Modular Inputs / JMS Messaging Module InputSplunk Modular Inputs / JMS Messaging Module Input
Splunk Modular Inputs / JMS Messaging Module Input
 
Userland Hooking in Windows
Userland Hooking in WindowsUserland Hooking in Windows
Userland Hooking in Windows
 
Balisage - EXPath - A practical introduction
Balisage - EXPath - A practical introductionBalisage - EXPath - A practical introduction
Balisage - EXPath - A practical introduction
 
XML Document Object Model (DOM)
XML Document Object Model (DOM)XML Document Object Model (DOM)
XML Document Object Model (DOM)
 
Tml for Objective C
Tml for Objective CTml for Objective C
Tml for Objective C
 
ExtjsPart1
ExtjsPart1ExtjsPart1
ExtjsPart1
 
IPTC News Exchange Formats Working Party Autumn 2012
IPTC News Exchange Formats Working Party Autumn 2012IPTC News Exchange Formats Working Party Autumn 2012
IPTC News Exchange Formats Working Party Autumn 2012
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
Shindig in 2 hours
Shindig in 2 hoursShindig in 2 hours
Shindig in 2 hours
 
Zentyal Customization (templates, hooks, LDAP)
Zentyal Customization (templates, hooks, LDAP)Zentyal Customization (templates, hooks, LDAP)
Zentyal Customization (templates, hooks, LDAP)
 
Ikenna Okpala: London Java Community: Wicket and Scala - 27/07/2010.
Ikenna Okpala: London Java Community: Wicket and Scala - 27/07/2010.Ikenna Okpala: London Java Community: Wicket and Scala - 27/07/2010.
Ikenna Okpala: London Java Community: Wicket and Scala - 27/07/2010.
 
Short Lightening Talk
Short Lightening TalkShort Lightening Talk
Short Lightening Talk
 
OCCIware, a formal framework for Everything as a Service. OW2con'15, November...
OCCIware, a formal framework for Everything as a Service. OW2con'15, November...OCCIware, a formal framework for Everything as a Service. OW2con'15, November...
OCCIware, a formal framework for Everything as a Service. OW2con'15, November...
 
OCCIware, a formal framework for Everything as a Service. OW2con'15, November...
OCCIware, a formal framework for Everything as a Service. OW2con'15, November...OCCIware, a formal framework for Everything as a Service. OW2con'15, November...
OCCIware, a formal framework for Everything as a Service. OW2con'15, November...
 
DotNetNuke – CMS redefined
DotNetNuke – CMS redefinedDotNetNuke – CMS redefined
DotNetNuke – CMS redefined
 

Recently uploaded

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

Taking Advantage of XMetaL’s XInclude Support

  • 1. in 37 minutes Episode 4 Taking advantage of XMetaL’s XInclude support Tom Magliery, XML Technology Specialist Brought to you by XMetaL Technical Services © 2010 JustSystems Inc.
  • 2. Announcements • Next time: Su-Laine “XMetaL for Simple XML Editing Editing” © 2010 JustSystems Inc.
  • 3. Agenda • Introduction • B i XI l d markup Basic XInclude k • XMetaL XInclude APIs © 2010 JustSystems Inc.
  • 4. What is XInclude • W3C XML standard • General purpose inclusion mechanism G l i l i h i • Including XML inside other XML • A general way to achieve content reuse © 2010 JustSystems Inc.
  • 5. XMetaL’s XInclude support • XMetaL automatically recognizes XInclude markup • XMetaL XInclude APIs allow customizers to add reuse functionality to document customizations © 2010 JustSystems Inc.
  • 6. Getting started • Step 1: Define XInclude elements in your DTD/schema • St 2: Put XInclude markup in your instance Step 2 P t XI l d k i i t document • Step 3: See what happens in XMetaL • ... © 2010 JustSystems Inc.
  • 7. STEP 1: XINCLUDE IN YOUR DTD OR SCHEMA © 2010 JustSystems Inc.
  • 8. XInclude specifies two new elements • <xi:include> – Pl Placeholder f referenced content h ld for f d t t – Pointer to referenced content – Put wherever you want to be able to include things • <xi:fallback> – Content to be displayed if XInclude resolution fails © 2010 JustSystems Inc.
  • 9. Example DTD with XInclude <?xml version="1.0" encoding="UTF-8"?> <!-- "-//Mag//DTD Simple Paper//EN" --> <!ELEMENT Paper ( p (Title, Author, ( , , (Section | xi:include)*) > ) ) <!ELEMENT Title (#PCDATA) > <!ELEMENT Author (#PCDATA) > <!ELEMENT Section (Title, (Para | Blockquote | xi:include)*) > <!ELEMENT Para (#PCDATA | Bold | Italic)* > <!ELEMENT Blockquote (#PCDATA | Bold | Italic)* > <!ELEMENT Bold (#PCDATA) > <!ELEMENT Italic (#PCDATA) > <!ELEMENT xi:include (xi:fallback?)> <!ATTLIST xi:include xmlns:xi CDATA #FIXED "http://www w3 org/2001/XInclude" http://www.w3.org/2001/XInclude href CDATA #IMPLIED parse (xml|text) "xml" xpointer CDATA #IMPLIED encoding CDATA #IMPLIED accept p CDATA #IMPLIED accept-language CDATA #IMPLIED > <!ELEMENT xi:fallback (#PCDATA|Para)*> <!ATTLIST xi:fallback xmlns:xi l i CDATA # #FIXED "http://www.w3.org/2001/XInclude" h // 3 /2001/ l d > © 2010 JustSystems Inc.
  • 10. STEP 2: XINCLUDE IN YOUR DOCUMENT MARKUP © 2010 JustSystems Inc.
  • 11. XInclude markup <xi:include h f " i i l d href="my_other_paper.xml" th l" xpointer="xpointer(/Paper/Section)"> <xi:fallback>This is fallback text.</xi:fallback> </xi:include> / © 2010 JustSystems Inc.
  • 12. Sample document <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Paper PUBLIC "-//Mag//DTD Simple Paper//EN" "simplepaper.dtd"> <Paper> <Title>This is my Paper</Title> <Author>John Q. Public</Author> <Section> <Title>First section</Title> <Para>First paragraph.</Para> <Para>Second paragraph.</Para> </Section> <xi:include href="my_other_paper.xml" xpointer="xpointer(/Paper/Section[1])"> <xi:fallback>This is fallback text.</xi:fallback> </xi:include> </Paper> © 2010 JustSystems Inc.
  • 13. STEP 3: SEE WHAT HAPPENS IN XMETAL © 2010 JustSystems Inc.
  • 14. STEP 4: DO STUFF WITH SCRIPT © 2010 JustSystems Inc.
  • 15. Implementing XML inclusions • XMetaL automatically recognizes XInclude markup • But there is no built-in user interface • Th There are new API APIs – XInclude-related methods/properties on Document and Application objects • Write script using APIs to implement desired functionality y © 2010 JustSystems Inc.
  • 16. Bonus tip: Pasting script • (Not related to XML inclusions) • C paste executable script code i t th Can t t bl i t d into the XMetaL main document window • R Requires specific script h d li i ifi i t header line: //XMetaL Script Language JScript: ActiveDocument.Host.Alert("Hello, world"); © 2010 JustSystems Inc.
  • 17. ShowXInclude(node) ShowXInclude(node) • Document object method • If node i an XI l d the t d is XInclude, th target is displayed t i di l d • Else, if node has XInclude ancestor(s), the nearest one is di l t i displayed d • Else, if node has XInclude descendants, they are all displayed – ShowXInclude(ActiveDocument.documentElement) will show a inclusions in the docu e s o all c us o s e document • NOTE: An XInclude must be updated at least once before it can be displayed p y © 2010 JustSystems Inc.
  • 18. UpdateXInclude(node) UpdateXInclude(node) • Document object method • Same rules about which node(s) are affected S l b t hi h d ( ) ff t d • Causes a “refresh” of the affected node(s) • Does not change visibility of the included content © 2010 JustSystems Inc.
  • 19. HideXInclude(node) HideXInclude(node) • Document object method • Same rules about which node(s) are affected S l b t hi h d ( ) ff t d • Hides the target content of affected nodes • Display reverts to fallback content © 2010 JustSystems Inc.
  • 20. OpenXIncludeTarget(node) OpenXIncludeTarget(node) • Document object method • If node i an XI l d opens the t d is XInclude, th target t document (specified in href) • El if node h XI l d ancestor(s), opens Else, d has XInclude t ( ) the target document of the nearest one © 2010 JustSystems Inc.
  • 21. Some other interesting APIs • ExportWithXIncludesToFile(strFile) • E ExportWithXIncludesToXML() tWithXI l d T XML() – Returns an XML string • Li kR l ti E Li t LinkResolutionErrorList – Property, returns ValidationErrorList object • ResultsManager object – Application.ResultsManager.ShowLinkLogTab() – Application ResultsManager HideLinkLogTab() Application.ResultsManager.HideLinkLogTab() © 2010 JustSystems Inc.
  • 22. Documentation • Full documentation on the XML inclusion APIs is in XMetaL Developer 6.0 docs 60 © 2010 JustSystems Inc.
  • 23. Some possible functionality • Menu commands: –IInsert XML inclusions t i l i – Show or hide all inclusions • Context menu commands: – Hide or show one XML inclusion – Open XML inclusion target • Other – Combine with “Treat as link AI button Treat link” – Custom dialogs © 2010 JustSystems Inc.
  • 24. DocBook sample • Included* with XMetaL 6.0 • Ill t t several XI l d f t Illustrates l XInclude features • (DEMO) * No pun intended © 2010 JustSystems Inc.
  • 25. Resources • XMetaL Community Forums – htt //f http://forums.xmetal.com/ t l / • JustSystems Partner Center – http://justpartnercenter com/ http://justpartnercenter.com/ • Ask us for help (partner tech support) – partnersupport na@justsystems com partnersupport-na@justsystems.com © 2010 JustSystems Inc.