473,788 Members | 2,924 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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"
elementFormDefa ult="qualified" attributeFormDe fault="unqualif ied">
<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:styleshe et 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 "
elementFormDefa ult="qualified" attributeFormDe fault="unqualif ied">
<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:schemaLocat ion="Page3 Page3tns.xsd">
...

--XSL--
<?xml version="1.0" encoding="UTF-8"?>
<xsl:styleshe et 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:so urce">
<xsl:apply-templates select="Page3:b old"/>
<xsl:apply-templates select="Page3:r ed"/>
<xsl:apply-templates select="Page3:i talic"/>
</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 2557

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

Similar topics

1
18389
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 which have no prefix are somehow now part of the namespace - would it need to upload the definitions?
2
10029
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 others' thoughts on it (disclaimer, obviously I'm no XML expert so forgive me if these are basic). --------Exhibit A: The start of a response message schema----------- <xsd:schema targetNamespace="http://www.QQQ.com"
1
1484
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 targetNamespace a http and I don't know what's the well formed URI to say my Schem is in C:\skima\ C:\skima\
3
2583
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? Marcus
0
1235
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 attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.ciber.com/myfile" version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
1
1347
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 targetnamespace the program works fine. I want to create an xsd with the following namespaces <xsd:schema targetNamespace"http://www.homedepot.com/HD"
5
5404
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 separate files for ease of maintainability. These schemas are all part of the same namespace. When defining a web service that access more than one of these entities, the wsdl file generated by BEA contains multiple schema elements with the same...
0
865
by: steph | last post by:
Is there a way to specify targetNamespce for the out parameter of a web service method? -- steph
4
3942
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): ---------------------------------------------------------------------------- <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns="http://tempuri.org/ae" elementFormDefault="qualified" targetNamespace="http://tempuri.org/ae" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="FileContratti">
0
9498
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,...
0
10364
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10172
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
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
9967
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
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
7517
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
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4069
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

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.