473,790 Members | 2,951 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

need help with xinclude

CB
I am using xerces 2.5.0 and xalan 2.6.0, and am following the xinclude
instructions on the xerces faq at
http://xml.apache.org/xerces2-j/faq-xinclude.html, and I am having no
luck. I imagine I must be missing something fundamental, can someone
point it out, please?

Here are all the gory details;

---- command line ----

java \
-Djava.endorsed. dirs='/usr/local/xerces-j;/usr/local/xalan-j' \
-Dorg.apache.xer ces.xni.parser. XMLParserConfig uration=\
org.apache.xerc es.parsers.XInc ludeParserConfi guration \
org.apache.xala n.xslt.Process -in world.xml -xsl simple.xslt

---- simple.xsd ----

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefa ult="qualified" attributeFormDe fault="unqualif ied">
<xs:element name="root">
<xs:complexType >
<xs:sequence>
<xs:element name="element"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

---- hello.xml ----

<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespace SchemaLocation= "simple.xsd ">
<element>hell o</element>
</root>
---- world.xml ----

<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespace SchemaLocation= "simple.xsd ">
<xi:include href="hello.xml "
xmlns:xi="http://www.w3.org/2003/XInclude" />
<element>worl d</element>
</root>

---- simple.xslt ----

<?xml version="1.0" encoding="UTF-8"?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" indent="no"/>
<xsl:template match="//root/element">
<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>

---- expected output ----

hello
world

---- actual output ----

world
Jul 20 '05 #1
1 1754
On 25/08/04 23:07, CB wrote:
I am using xerces 2.5.0 and xalan 2.6.0, and am following the xinclude
instructions on the xerces faq at
http://xml.apache.org/xerces2-j/faq-xinclude.html, and I am having no
luck. I imagine I must be missing something fundamental, can someone
point it out, please?


I believe you will need these:

javax.xml.parse rs.DocumentBuil derFactory=
org.apache.xerc es.jaxp.Documen tBuilderFactory Impl
javax.xml.parse rs.SAXParserFac tory=
org.apache.xerc es.jaxp.SAXPars erFactoryImpl

Pass them with -D or put them in a file called jaxp.properties in the
lib directory of the JRE. I believe, the Java runtime won't use Xerces
without these but will resort to its own Crimson parser.

Ciao,
Igor
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2727
by: Dr. Laurence Leff | last post by:
I am having trouble doing the basics with xmlto on Redhat to convert DocBook XML into the various files. I believe the problem is the first line on the files: Here is starter file (notes.xml): <!DOCTYPE Book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"> <!ENTITY chap1 SYSTEM "chap1.xml"> <Book><title>CS310 notes</title></BOOK>
3
1430
by: annoyed tuna | last post by:
I was wondering if someone could help me out. I'm trying to perform an XSL transformation on an XML document that uses entities. While I can do XSLT on a file without entities, it all falls apart when I try and add an entity. Here are my files... -----TEST.XML------ <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="test.xsl"?> <!DOCTYPE document >
1
1491
by: Larry | last post by:
Given the "includer" xml file: <?xml version="1.0"?> <test-includer xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:testns="http://www.w3.org/TR/REC-xml-names" xmlns:xi="http://www.w3.org/2001/XInclude" > <xi:include href="test-included.xml"
9
2104
by: Tjerk Wolterink | last post by:
I have an xml document that conforms to my xschema document. Now i wanted to use xinclude in my xml document. But when i want to validate the xml document to the xschema i get the following error: -- Validating "structure.xml" against
11
1850
by: john fra | last post by:
Hi, I want to include a part of many XML files into an unique XML file with XInclude. Example! File1.xml, File2.xml, File3.xml... seems to that : <?xml version="1.0" encoding="UTF-8"?>
0
857
by: daleko | last post by:
Hi All, I have to add to my xml the element that lok like: <smemn:member xmlns:scatm="conceptispuzzles.com/xsd/core/atom" xmlns:xi="http://www.w3.org/2001/XInclude"> I did something like this: XmlElement xmlElementChild3 = xmlDocument.CreateElement("smemn", "member", "conceptispuzzles.com/xsd/core/atom"); but I did'nt received the target view.
7
1873
by: shaun roe | last post by:
I should like to use xslt to produce a document like the following: <crate xmlns:xi="http://www.w3.org/2001/XInclude"> <rod id="0"> <slot>1</slot> <xi:include href="./endcapA/disk/1a/10011.xml"/<!--D1A TR middles--> <xi:include href="./endcapA/disk/1a/10012.xml"/<!--D1A TR middles--> <xi:include href="./endcapA/disk/1a/10001.xml"/<!--D1A TR
0
1152
by: Joseph J. Kesselman | last post by:
Kenneth Porter wrote: Write an XSLT stylesheet rather than using XInclude?
2
2772
by: McSwell | last post by:
I have an XML file that looks something like this: ------------------------ <?xml ...?> <!DOCTYPE ...> <src:fragment id="foo" ...> <Ph:Itemsome stuff </Ph:Item> <Ph:Itemsome more stuff </Ph:Item> .... <Ph:Itemstill more stuff </Ph:Item> </src:fragment>
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9512
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10147
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9023
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5424
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5552
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4100
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2910
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.