I've got a bit of a problem, and I'm stumped.
I'm working on a system to create web pages based on XML files. I'd like
to be able to use a variety of techniques to make the coding faster & more
maintainable.
To that end, I have some XML and XSLT files that I use as 'subroutines' to
build the pages faster. All pretty standard stuff.
My problem is this: I have two xml/xslt file pairs that I'm using, and
they both use their own namespace. One works, and one doesn't and I can't
tell why the one doesn't work.
-----------------------
index.xml:
<?xml version="1.0"?>
<!DOCTYPE page[
<!ENTITY navtree SYSTEM "nav.xml">
]>
<page xmlns:xform="ht tp://cfconsulting.ca/xmlform/1.0">
<title>Page Title</title>
<navtree>&navtr ee;</navtree>
<body>
<sect>
<title>Form Test</title>
<p>Form follows this:</p>
<xform:form>
<xform:textwidg et name='test_text ' value='a test value'/>
<xform:buttonwi dget name='test_but' value='Submit'/>
</xform:form>
</sect>
</body>
</page>
-----------------
xform.xsl:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
xmlns:xform="ht tp://cfconsulting.ca/xform/1.0">
<xsl:template match="xform:fo rm">
<form>
<xsl:apply-templates />
</form>
</xsl:template>
<xsl:template match="xform:te xtwidget">
<input type="text" name="{@name}" value="{@value} " />
</xsl:template>
<xsl:template match="xform:bu ttonwidget">
<input type="button" name="{@name}" value="{@value} " />
</xsl:template>
</xsl:stylesheet>
The nav.xml file defines & uses a namespace (nav:), which is referenced in
the nav.xsl file. That works fine. I get my navigation tree.
The xform (yes, I know about XFORMS, this is just a convenient name for
now) namespace, however, is for some reason ignored. When I use xsltproc
with -v, I can see it parse the xform namespace, but when it gets to
parsing this file, it says that there is no handler for 'textwidget' and
'buttonwidget'.
If I take the xform namespace right out, of both the index.xml and the
xform.xsl file, the form works. If the namespace is in use, the form isn't
there.
I'm sure I'm doing something stupid in regards to using or defining the
xform namespace, but I can't figure out what it is, and the xsltproc
debugging dump isn't any help (at least in this case).
Suggestions?
cf 2 2034
Colin Fox wrote: I'm working on a system to create web pages based on XML files. I'd like to be able to use a variety of techniques to make the coding faster & more maintainable.
To that end, I have some XML and XSLT files that I use as 'subroutines' to build the pages faster. All pretty standard stuff.
My problem is this: I have two xml/xslt file pairs that I'm using, and they both use their own namespace. One works, and one doesn't and I can't tell why the one doesn't work. ----------------------- index.xml: <?xml version="1.0"?> <!DOCTYPE page[ <!ENTITY navtree SYSTEM "nav.xml"> ]> <page xmlns:xform="ht tp://cfconsulting.ca/xmlform/1.0">
^^^^^^^
xform.xsl: <?xml version="1.0" encoding="iso-8859-1"?> <xsl:styleshe et version="1.0" xmlns:xsl="http ://www.w3.org/1999/XSL/Transform" xmlns:xform="ht tp://cfconsulting.ca/xform/1.0">
^^^^^^
so the namespace here is different.
--
Martin Honnen http://JavaScript.FAQTs.com/
On Sun, 11 Jan 2004 12:18:13 +0100, Martin Honnen wrote: xform.xsl: <?xml version="1.0" encoding="iso-8859-1"?> <xsl:styleshe et version="1.0" xmlns:xsl="http ://www.w3.org/1999/XSL/Transform" xmlns:xform="ht tp://cfconsulting.ca/xform/1.0"> ^^^^^^ so the namespace here is different.
Sigh. I knew it would be something stupid. It's so easy to overlook the
obvious. Thanks!
cf This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Greg Wogan-Browne |
last post by:
Hi all,
I am having some trouble figuring out what is going on here - is this a
bug, or correct behaviour? Basically, when I create an XML document with
a namespace using xml.dom.minidom.parse() or parseString(), the
namespace exists as an xmlns attribute in the DOM (fair enough, as it's
in the original source document). However, if I use the DOM
implementation to create an identical document with a namespace, the
xmlns attribute is not...
|
by: cyclops |
last post by:
I'm trying to do XML + XSLT -> Another XML. The source XML contains
multiple namespaces and XSLT will handle all possible tags under each
name space.
----source----
<document xmlns="..." xmlns:a="..." xmlns:b="">
....
----XSLT----
....
|
by: Sammy |
last post by:
Hi, my mind is going crazy. I have tried everything I can think of to
no
avail.
I have tried Disable Output Escaping.
I tried to think of a way of enclosing the attribute data in a CDATA
element. That did not parse.
Here is my question:
How can I get attribute values to not get converted from ' to '
|
by: Wil |
last post by:
I'm very new to developing in .NET and even newer to XML. The past few days
have been pretty frustrating for me because I'm trying to perform a transform
on data in a dataset and it's not working.
Basically, all of the data is stored in an Access .mdb that is read into a
dataset when the application is loaded. There are some minor changes to the
schema between what is in the physical database to accomodate some things
that Access just...
|
by: David Thielen |
last post by:
Hi;
If there are no namespaces this works fine for me. But if the xml has
namespaces, then I get either no node back or an exception.
Here is the sample xml:
<root xmlns="http://www.test.org"
xmlns:sns="http://www.test.org/sub"
xmlns:mns="http://www.test.org/mini">
<data>
| |
by: David S. Alexander |
last post by:
How can I do simple subtraction in an XSLT.
I want to read a few attribute values from an XML document, calculate their
difference, and transform that value to an attribute in the XML output
document.
My original XML is,
<Dates>
<Birth Year="1966" />
|
by: Rajesh |
last post by:
I am trying to pass the namespace, which is in my Original Message, to
a Java method for further processing. In the original message the
xmlns:xenc namespace is present. I make a call to Java function and
pass the whole XML message along with tags and values. In my Java
function when I tried to print the XML message which is receieved by
the XSLT proc. it has omitted the xmlns:xenc namespace which is
creating a problem in Java function for...
|
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...
|
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...
|
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...
|
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...
| |
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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: 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...
| |