473,386 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

targetNamespace and XSL

CB
I'm just picking up XSL, and am having problems with namespaces. None
of the posts I've read through/tried seem to work so I must be missing
something basic. Please help.

I started with a simple example, and created an XSD, XML and XSL that
work. They are;

---XSD--
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="source">
...

--XML--
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="Page3.xsl"?>
<source>
...

--XSL--
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="source">
<xsl:apply-templates select="bold"/>
<xsl:apply-templates select="red"/>
<xsl:apply-templates select="italic"/>
</xsl:template>
...
As I said, this all works, and I get my expected outputs. Now,
I want to add a targetNamespace to the XSD. So, I've changed my
three files as follows;
---XSD--
<xs:schema targetNamespace="Page3"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:p3="Page3"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="source">
...

--XML--
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="Page3tns.xsl"?>
<source xmlns="Page3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="Page3 Page3tns.xsd">
...

--XSL--
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:Page3="x-schema:Page3tns.xsd">
<xsl:template match="Page3:source">
<xsl:apply-templates select="Page3:bold"/>
<xsl:apply-templates select="Page3:red"/>
<xsl:apply-templates select="Page3:italic"/>
</xsl:template>
...

This won't work. I've tried several variations on the namespace
for p3 and Page3, and I've gotten various error messages and
incorrect output.

So, what is the correct line for declaring the Page3 namespace in
the XSL?
Jul 20 '05 #1
0 2534

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

Similar topics

1
by: kevin bailey | last post by:
hi there, i'm reading up on schema - but am probably missing something obvious RE targetnamespace i know there can only be one... is it that the elements which are defined in the schema...
2
by: Charles Fineman | last post by:
I've been asked to look over an integration toolkit that has a bunch of schemas to specify message format. There are a couple of strange things I noticed right off the bat and I wanted to get...
1
by: Gianni Rubagotti | last post by:
I'm writing an XMl schema to learn and I have a problem I want that my schema work on my PC, not to put it on the internet but everytime I serach in tutorials the examples put as value of...
3
by: Markus Meckler | last post by:
Somewhere (I don't remember where) that Is it possible to enter a simple string as namespace in a xsd schema definiton. E.g.: <xsd:schema targetNamespace="mydomainstring"> Is this true? ...
0
by: comic_rage | last post by:
Hi, I am trying to add the targetNamespace with the xmlns to my xml schema file, but I am getting the following <?xml version="1.0" encoding="utf-8"?> <xsd:schema...
1
by: Maansi Sanghi | last post by:
Hello, I am trying to write an xsd file using .NET System.Xml.Sxhema Class Library. (1) I get an error while writitng if the XSD has a taregetnamespace. (II) for any xsd with no...
5
by: Jeff | last post by:
We are using .Net and the wsdl Utility to generate proxies to consume web services built using the BEA toolset. The data architects on the BEA side create XML schemas with various entities in...
0
by: steph | last post by:
Is there a way to specify targetNamespce for the out parameter of a web service method? -- steph
4
by: fedrok | last post by:
Hi you all. I've got a problem validating an XML file using the following Schema (I'll post only the beginning of this): ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.