Oxygen XML Editor

xml editor

About
Downloads
Register
Shop
Resources
Support
Supported platforms
It is currently Sat Jul 04, 2009 3:44 pm

All times are UTC + 2 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: XInclude, XPointer, & Oxygen: what works?
PostPosted: Sat Sep 20, 2008 12:23 am 
Offline

Joined: Fri Sep 19, 2008 8:43 pm
Posts: 1
I think I've read all the current posts on XInclude/XPointer, and some of the older ones; it is difficult to sort out what comments still apply today. So here's my situation -- I want to grab (import on XSL processing) the contents of Deployment in the included file below, which does not have an 'id' attribute in the schema at the moment. What is it I don't understand in XInclude, XPointer, Oxygen, or is there a better way to do this simple thing?

I'm using Oxygen 9.3, mostly with the default parser, but also with Xsltproc. I have tried about 20 ways of putting fragment/entity/pointer information into an xi:include statement, all of them copied off of allegedly working examples on the web, with only 1 success. Using xi:include without xpointers or fragments works, but I get the whole document of course; and if I use "element(/1/1/1)", this works, but is fragile of course.

With fragments like 'href=1632.xml#/Metadata", I get "Fragment identifiers must not be used."

WIth xpointer="/", "/Metadata", "//", etc., I get: "InvalidShortHandPointer: The NCName of the ShortHand Pointer '/' is invalid."

My understanding is that xpointer supports XPath patterns, but apparently I'm not grokking how to do that correctly.

My included file is '1632.xml', as follows:
Code:
  <Metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="http://ourschemalocation">
     <Deployment> 
          <Device name="TestName" />
          <output>more stuff</output>
     </Deployment>
  </Metadata>


My encompassing file is of the form
Code:
<?xml version="1.0" encoding="UTF-8"?>
<Metadata   xsi:noNamespaceSchemaLocation="http://myschemalocation" >
    <DataProducer name="2008.09.18">
          <DataProducer name="Port Optode">
              <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="1632.xml" xpointer="/" >
              <xi:fallback>
                 <Device name="ERROR: could not include data from 1632.xml" id="1632">
                 </Device>
                </xi:fallback>
              </xi:include>   
        </DataProducer>
    </DataProducer>
</Metadata>


Last edited by graybeal on Mon Sep 22, 2008 5:29 pm, edited 1 time in total.

Top
 Profile E-mail  
 
 Post subject: Re: XInclude, XPointer, & Oxygen: what works?
PostPosted: Mon Sep 22, 2008 12:00 pm 
Offline

Joined: Fri Jul 09, 2004 5:18 pm
Posts: 430
Hi,

Oxygen uses Xerces to validate XIncludes.

Xerces does not fully support the XPointer syntax. See this http://xerces.apache.org/xerces2-j/faq-xinclude.html#faq-8

It only supports the XPointer element() Scheme http://www.w3.org/TR/2003/REC-xptr-element-20030325/ which means you can use XPointer values like
Code:
element(/1/2)
to address the second child of the root element.

In order to use correctly the XPointer XPath syntax the XPointer attribute value should be like:
Code:
xpointer(/sect1/para)
for which Xerces gives a clear error messsage :
Code:
SchemeUnsupported: The XPointer scheme 'xpointer' is not supported.


Although Oxygen shows validation errors, we tested and the XPointer scheme seems to work when transforming the XML file using XSLT Proc.

Regards,
Radu

_________________
Radu Coravu
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 2 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000-2007 phpBB Group
© 2002-2009 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>® XML Editor