Mikael Svenning | 4 Jan 2013 13:23
Picon

Validating XML with attributes in namespace "xml"

Hello,
I have a question regarding namespaces for attributes, and how to declare such attributes in an XML schema.

The reason that I want to use namespaces for an attribute is that I use XML DSig,
and the signature parts should be specified with an "ID" attribute.

The name of the attribute that specify the identification could have any name, and some possible choices are "ID", "Id" or "id".

However, there seems to be a recommendation to use "xml:id", rather than anything else such as "ID".

This is for example described in the following page:
http://www.w3.org/TR/xml-id/

This works fine for DSig signatures.
I am using "xmlsec1" for signing/verification in my C++ application, and I am able to sign and verify the signature.

In the XML files, the id is specified like this:

<elm:MyElement xml:id="MyName" OtherAttribute="SomeValue">

Note that "xml:id" is an attribute in a namespace, which is rarely used although legal XML.
However, the XML files should also be validated against a schema with Xerces, and it is there I have some problems.

The problem is probably that I do not specify the schema correctly, rather than a problem in Xerces-C.


I have tried to specify the attribute name as "xml:id" in the scheme like this:
==========================================
                        <xs:attribute name="xml:id" use="required">
                                <xs:simpleType>
                                        <xs:restriction base="xs:string">
                                                <xs:enumeration value="MyName"/>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:attribute>
==========================================


However, when I try to validate the document, I get the following error message:
==================================
Error at file XMLParserInput, line 1, char 441
  Message: attribute '{http://www.w3.org/XML/1998/namespace}id' is not declared for element 'Routing'
==================================

My XML document has an "xml:id" attribute, but the Xerces validator does not seem to think
that this attribute is declared according to the schema.

My question now is how I should write the XML schema to make it accept "xml:id"?

I have searched on the net, and I have got some hints, for example this:

http://xsd.stylusstudio.com/2004Oct/post01004.htm

But my XML schema is more complicated, and consists of several xsd files and multiple namespaces,
so I have not been able to make it validate with Xerces.


My XML file declares something similar to the following:
===============================
<soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-env
elope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:qwerty="http://www.mycompany
.se/qwert" xmlns:abcd="http://www.mycompany.se/abcd">
===============================

The schema file(s) declares information similar to this:
===============================
<xs:schema xmlns:abcd="http://www.mycompany.se/abcd" xmlns:xs="http://www.w3.org/2001/XMLSchem
a"  targetNamespace="http://www.mycompany.se/abcd" elementFormDefault="qualified" attributeFor
mDefault="unqualified">
===============================

Can you give some hints how I should declare the XML schema to validate the XML file with xml:id?


Regards
/Mikael



B.J. Herbison | 27 Dec 2012 18:52

Bad link to source of xml-commons

I wanted to look at the source of xml-commons and follow the browse link from http://xerces.apache.org/xml-commons/ to http://svn.apache.org/viewvc/xml/commons/ and received a 404.

 

What is the correct link to browse the source?

 

                                                                                                Thanks,

                                                                                                B.J.

B.J. Herbison

Veracode, Inc.

BJHerbison <at> Veracode.com

 

Arjan Bokx | 31 Dec 2012 10:30
Picon

Getting FOP emedded examples to work

Hello everybody,

I have a question about getting the "embedded" examples of FOP 1.1 to work.
Is this the right place to ask?
(If not, please redirect me and disregard the following)

I've downloaded and installed fop 1.1
I've downloaded and installed Ant.
With Ant, I compiled the "embedded" examples.
"Ant example1" correctly runs ExampleFO2PDF.
What should I do to call ExampleFO2PDF from Java? Actually I wish to call it from Delphi, using JNI, but first
things first.
"Java ExampleFO2PDF" gives:
Exception in thread "main" java.lang.NoClassDefFoundError: ExampleFO2PDF (wrong name: embedding/ExampleFO2PDF)

When I add just about every path to the classpath with the command line option -cp, I get:
Error: Could not find or load main class ExampleFO2PDF.main

Could you help me please.

Regards,
Arjan Bokx
pa7751 | 22 Oct 2012 11:21
Picon

Multi threading and xml

Hi I have an xml file that has to be written by multiple threads running in parallel. How can we ensure that the structural integrity of the xml file i.e. many threads writing into the file can spoil the structure of the xml. One way is to make the write method synchronized, but that is a very high level approach with which only one thread may write at a time. So the other threads are ready with their data but cannot write until the lock is released. Is there a better way to do this?

View this message in context: Multi threading and xml
Sent from the Apache XML - General mailing list archive at Nabble.com.
pa7751 | 9 Oct 2012 14:16
Picon

How to parse xml


Hi 

I have a requirement where i have a valid xml that I need to parse so that
the elements of the xml can be made to behave in some manner. I need to know
two things: 

1. Which parser is best to use DOM, SAX etc.
2. Which parser library can I use. Here please note that my JRE can be 1.4 o
1.6. So my code should be compatible with these versions

Note that my xml may not be very big in size. It can have a maximum of 200
elements maybe 
--

-- 
View this message in context: http://old.nabble.com/How-to-parse-xml-tp34531631p34531631.html
Sent from the Apache XML - General mailing list archive at Nabble.com.
Gianugo Rabellino | 15 Aug 2011 20:39
Picon
Favicon
Gravatar

[DRAFT][REPORT] XML board report - August 2011

(unless anyone chimes in, I'm going to post this later today)

The big news from the XML project is that we finally managed to start
the process of moving XIndice to the Attic. The vote just passed, and
the move will start in the next few days. Once we are done with that,
it will be time for a last call to the various xml-related projects to
see what we should do with the existing xml web properties (DTDs and
other resources), then we will be able to fold the XML project
altogether.

No other issues requiring board attention at this time.

--

-- 
Gianugo Rabellino - gianugo at rabellino dot it
Blog: http://boldlyopen.com
Gianugo Rabellino | 12 Aug 2011 19:23
Picon
Favicon
Gravatar

[VOTE] Move XIndice to the Attic

Further to lack of volunteering on the headsup given to the XIndice
mailing lists (http://s.apache.org/xindice-attic-thread), and with two
existing committers in agreement on moving the project to the Attic,
here is an official vote to make it happen.

This vote will be open for 72 hours from now. Everyone is welcome to
chime in, but the only binding votes will be from the XML PMC members,
and I'm asking to keep the XIndice mailing list in the loop.

Please cast your vote as follows:

[+1] Move XIndice to the Attic

[ 0] I don't really care

[-1] No, don't move it to the Attic and I volunteer to find an
alternate solution

Here is my +1.

--

-- 
Gianugo Rabellino - gianugo at rabellino dot it
Blog: http://boldlyopen.com
Gianugo Rabellino | 5 Aug 2011 00:14
Picon
Favicon
Gravatar

[IMPORTANT] The future of XIndice

All,

this is an important message for the XIndice community: as some of you
may have noticed, the Apache XML project has been in a "winding down"
mode for a while, with most projects either moving to top level
(xerces.apache.org, xalan.apache.org) or to the Attic (AxKit,
Crimson). XIndice is now the only project left, and it's time to
discuss about the project's future. There are two ways forward: the
top level project route (creating xindice.apache.org with its own PMC)
or, if the project isn't active enough to create a PMC, the Attic (see
http://attic.apache.org).

The XML project has no opinion on either, but know that if the XIndice
community doesn't step up to own the project, the only choice left
will be the Attic. Which, by the way, means hibernation not death: the
software remains available both in binaries and source code (although
in strict read-only mode), forks remain possible and projects can exit
the Attic at any time, although to do that they need to prove they
have a viable community standing behind them.

This is a message to get the discussion going: if you want to keep
XIndice as a full-fledged Apache project, this is your turn to step
up! If you feel you want to help, participate, contribute and use
XIndice, we would be glad to hear from you and, as the XML PMC, more
than willing to hand XIndice over to a newly formed TLP. Personally,
I'm happy to help with either transitions, be it to a TLP or to the
Attic. Given that the project has been inactive in the past, I'm
planning to wait for a week to see if a discussion gets going: if
that's not the case, my plan is to start a vote in the XML PMC to
retire XIndice to the Attic.

Looking forward to your suggestions,

--

-- 
Gianugo Rabellino - gianugo at rabellino dot it
Blog: http://boldlyopen.com
Gianugo Rabellino | 18 May 2011 00:59
Picon
Favicon
Gravatar

[REPORT] XML project, May 2011

No issues requiring board attention, other than the fact there are no
issues and no activity at all in the XML project. It's probably time
we ask (what's left of) the XIndice community what they want to do
with their project, and move the XML umbrella to the Attic. Will try
and find cycles before the next report to make it happen and/or find
closure.

--

-- 
Gianugo Rabellino - gianugo at rabellino dot it
Blog: http://boldlyopen.com
Patrick Moldenhauer | 5 Apr 2011 09:57
Picon
Favicon

XML-Soap Namespace Definition DOWN

Dear Mailing-List,

 

I want to inform you guys that the XML-Soap Namespace Definition File http://xml.apache.org/xml-soap seems to be offline. Now many of our Webservices don’t work anymore. Is anybody working on that issue? Can I do anything?

 

Sincerly,

Patrick

 

Gianugo Rabellino | 14 Feb 2011 08:52
Picon
Favicon
Gravatar

[REPORT] XML Project board report, February 2011

No issues requiring board attention at this time - and actually no
issues at all in what is now to all extent a dormant project. Will try
and tackle how to deal with XIndice (spin off? attic?) for the next
board report. In the meantime, the XIndice mailing list is still
attended and questions are being answered.

--

-- 
Gianugo Rabellino - gianugo at rabellino dot it
Blog: http://boldlyopen.com

Gmane