Re: [xml] Making sequence entries option in .xsd files.

2016-06-08 Thread Pete Cordell

On 08/06/2016 09:40, Steve Underwood wrote:

On 06/06/2016 07:52 PM, Steve Underwood wrote:

Hi,

In the .xsd file for the DLMS Smart Grid protocol I find the following
section:


Re: [xml] Availability of libxml2-2.9.4

2016-05-23 Thread Pete Cordell

On 23/05/2016 09:15, Daniel Veillard wrote:

(sorry Pete, didn't managed to fix the regexp issue
yet :-\ )



One outa two ain't bad (to quote Meatloaf - kinda!) :-)  Thanks for trying.

Perhaps more importantly, did you get the patch with the test and 
results in there, or do I need to send it again?


Pete Cordell
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Availability of libxml2-2.9.4 release candidate 2 - regexp

2016-05-09 Thread Pete Cordell

On 09/05/2016 13:55, Daniel Veillard wrote:

On Mon, May 09, 2016 at 11:35:28AM +0100, Pete Cordell wrote:

On 09/05/2016 10:26, Daniel Veillard wrote:
Is this OK?  I used git format-patch.  I'm new to submitting diffs!  If you
want another format let me know.


Yup, just add it as an attachment instead, it's easier to process and avoid
mail agents and tools to mess with the content. Also would need to results ;-)


Hopefully the attached is better...

Pete.
Date: Mon, 9 May 2016 11:08:26 +0100
Subject: [PATCH] Additional regexp test vectors

---
 result/regexp/multiple-rollback-paths |  2 ++
 result/regexp/optional-as-zero-one| 15 +++
 test/regexp/multiple-rollback-paths   |  2 ++
 test/regexp/optional-as-zero-one  | 15 +++
 4 files changed, 34 insertions(+)
 create mode 100644 result/regexp/multiple-rollback-paths
 create mode 100644 result/regexp/optional-as-zero-one
 create mode 100644 test/regexp/multiple-rollback-paths
 create mode 100644 test/regexp/optional-as-zero-one

diff --git a/result/regexp/multiple-rollback-paths 
b/result/regexp/multiple-rollback-paths
new file mode 100644
index 000..84d53b7
--- /dev/null
+++ b/result/regexp/multiple-rollback-paths
@@ -0,0 +1,2 @@
+Regexp: ((2{1,2}|24)\.){2}2
+24.24.2: Fail
diff --git a/result/regexp/optional-as-zero-one 
b/result/regexp/optional-as-zero-one
new file mode 100644
index 000..9eccc6b
--- /dev/null
+++ b/result/regexp/optional-as-zero-one
@@ -0,0 +1,15 @@
+Regexp: ab?c{0,1}
+a: Ok
+ab: Ok
+abc: Ok
+ac: Ok
+Regexp: ab?c?
+a: Ok
+ab: Ok
+abc: Ok
+ac: Ok
+Regexp: ab{0,1}c{0,1}
+a: Ok
+ab: Ok
+abc: Ok
+ac: Ok
diff --git a/test/regexp/multiple-rollback-paths 
b/test/regexp/multiple-rollback-paths
new file mode 100644
index 000..eea526a
--- /dev/null
+++ b/test/regexp/multiple-rollback-paths
@@ -0,0 +1,2 @@
+=>((2{1,2}|24)\.){2}2
+24.24.2
diff --git a/test/regexp/optional-as-zero-one b/test/regexp/optional-as-zero-one
new file mode 100644
index 000..0c696f1
--- /dev/null
+++ b/test/regexp/optional-as-zero-one
@@ -0,0 +1,15 @@
+=>ab?c{0,1}
+a
+ab
+abc
+ac
+=>ab?c?
+a
+ab
+abc
+ac
+=>ab{0,1}c{0,1}
+a
+ab
+abc
+ac
-- 
2.5.3.windows.1

___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Availability of libxml2-2.9.4 release candidate 2 - regexp

2016-05-09 Thread Pete Cordell
Thanks Daniel.  I've managed to verify that the ab?c{0,1} pattern now 
works.  But the following pattern still appears to fail:


=>((2{1,2}|24)\.){2}2
#fails
24.24.2

Also, I see you haven't had a chance to put the test vectors in the 
test/regexp dir.  If you let me know what form you'd like them in I 
could submit something as a patch / copy of files / whatever.


Thanks again,

Pete.

On 09/05/2016 03:56, Daniel Veillard wrote:

   As planned I tagged in git a release candidate 2, and pushed to the
server the signed tarball and rpms for rc2:

ftp://xmlsoft.org/xml/

   I will run this on my machine until the release and try to see if there
is any nastyness popping up. I suggest others to do so too for their workload !

  I still have pending patches, but most likely next week end I will push the
final 2.9.4, if things don't look nice I may push an rc3 instead.

   Please give it some testing and report,

 thanks !

Daniel


___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


[xml] Additional regexp test files

2016-04-15 Thread Pete Cordell

Hi there,

Please can I submit the following regexp test files that should pass, 
but when I test them they fail.  (I'm afraid I'm not smart enough to 
suggest how to fix the code!)


I've attached them and included a git patch so hopefully one of the 
formats is convenient for you.  If not, let me know what would work 
better.  I've included them inline below so you can do a quick scan.


test/regexp/fussyipaddress
--
=>((1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])
192.168.254.0

test/regexp/timestamp
-
=>\d{8}T\d{6}\.?\d{0,6}
# This gives incorrect result
20160412T112319
# These give correct result
20160412T112319.
20160412T112319.43
20160412T112319.432312

Thanks,

Pete.
--
-
Pete Cordell
Codalogic Ltd
C++ tools for C++ programmers, http://codalogic.com
Read & write XML in C++, http://www.xml2cpp.com
-
>From 8353cdd05e3ad8c241e5383ca0745948f7a6cc58 Mon Sep 17 00:00:00 2001
From: Pete Cordell <pete@codalogic.com>
Date: Fri, 15 Apr 2016 17:33:17 +0100
Subject: [PATCH] Added regexp tests that fail but should pass

---
 test/regexp/fussyipaddress | 2 ++
 test/regexp/timestamp  | 7 +++
 2 files changed, 9 insertions(+)
 create mode 100644 test/regexp/fussyipaddress
 create mode 100644 test/regexp/timestamp

diff --git a/test/regexp/fussyipaddress b/test/regexp/fussyipaddress
new file mode 100644
index 000..3e4b44f
--- /dev/null
+++ b/test/regexp/fussyipaddress
@@ -0,0 +1,2 @@
+=>((1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])
+192.168.254.0
diff --git a/test/regexp/timestamp b/test/regexp/timestamp
new file mode 100644
index 000..0cc4b59
--- /dev/null
+++ b/test/regexp/timestamp
@@ -0,0 +1,7 @@
+=>\d{8}T\d{6}\.?\d{0,6}
+# This gives incorrect result
+20160412T112319
+# These give correct result
+20160412T112319.
+20160412T112319.43
+20160412T112319.432312
-- 
2.5.3.windows.1

=>((1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])
192.168.254.0
=>\d{8}T\d{6}\.?\d{0,6}
# This gives incorrect result
20160412T112319
# These give correct result
20160412T112319.
20160412T112319.43
20160412T112319.432312
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml


Re: [xml] xmllint reports non-determinist content model for schema

2012-02-27 Thread Pete Cordell
I think it's fair to say that Daniel isn't a great fan is XML XSD Schema, so 
I imagine it won't be fixed too quickly.  I think libxml2's support for 
Relax NG is better.  It might be worth seeing if you can do what you want 
with that.  I've never tried it, but by all accounts Trang should be able to 
give you a start at converting your XSD to Relax NG if your schema is 
non-trivial.


HTH,

Pete Cordell
Codalogic Ltd
Interface XML to C++ the easy way using C++ XML
data binding to convert XSD schemas to C++ classes.
Visit http://codalogic.com/lmx/ or http://www.xml2cpp.com
for more info
- Original Message - 
From: Johan Corveleyn jcor...@gmail.com

To: Pete Cordell petexml...@codalogic.com
Cc: xml@gnome.org
Sent: Monday, February 27, 2012 8:29 AM
Subject: Re: [xml] xmllint reports non-determinist content model for schema


Thanks for confirming. That's already a big help :-).

Too bad that there is no other way to express this in XML Schema,
which works with xmllint.

I'll file an issue in the issue tracker, and hopefully someone will
find the time to fix this some day.

Cheers,
--
Johan

On Fri, Feb 24, 2012 at 2:58 PM, Pete Cordell petexml...@codalogic.com 
wrote:

FWIW, the schema looks OK to me and neither Visual Studio or the W3C's XSV
seem to report an error, so it does look like a libxml2 bug.

And I can't think of another way of expressing what you want that isn't
truly non-deterministic.

HTH a bit!

Pete Cordell
Codalogic Ltd
Interface XML to C++ the easy way using C++ XML
data binding to convert XSD schemas to C++ classes.
Visit http://codalogic.com/lmx/ or http://www.xml2cpp.com
for more info

- Original Message - From: Johan Corveleyn jcor...@gmail.com
To: xml@gnome.org
Sent: Friday, February 24, 2012 1:14 PM
Subject: [xml] xmllint reports non-determinist content model for schema



Hi,

This is my first post to this list. I searched the mailing list
archives and bugzilla, but couldn't find the exact issue I'm
confronted with (if I missed something, please point me to it).

I'm running into a non-determinist error with a schema even though I
don't think it's non-determinist (and both XSV and Xerces agree with
me; they too have no problem with the schema). I have reduced my
test-case to a simple example, see below.

Given the following schema:

?xml version=1.0 encoding=UTF-8?
xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema;
xs:element name=rules
xs:complexType
xs:sequence
xs:element name=rule minOccurs=0 maxOccurs=unbounded/
xs:sequence minOccurs=0 maxOccurs=1
xs:element name=specialRule minOccurs=1 maxOccurs=1/
xs:element name=rule minOccurs=0 maxOccurs=unbounded/
/xs:sequence
/xs:sequence
/xs:complexType
/xs:element
/xs:schema

xmllint version 20708 complains with Schemas parser error : local
complex type: The content model is not determinist.

The intention is to express that there can be any number of rule
elements, and there can be at most one specialRule (at any position
in between, before, or after the rules). So the following xml's are
all valid:

?xml version=1.0 encoding=UTF-8?
rules
rule/
rule/
specialRule/
rule/
/rules

?xml version=1.0 encoding=UTF-8?
rules
specialRule/
/rules

?xml version=1.0 encoding=UTF-8?
rules
specialRule/
rule/
rule/
rule/
/rules

?xml version=1.0 encoding=UTF-8?
rules
rule/
rule/
rule/
/rules

But this one isn't (two specialRules):

?xml version=1.0 encoding=UTF-8?
rules
specialRule/
rule/
rule/
specialRule/
rule/
/rules



Is this a bug in libxml2?

And whether or not it's a bug: any workarounds? Can I write my schema
in another way to make xmllint succeed, and still express the same
constraints?

--
Johan
___
xml mailing list, project page http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml





___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] xmllint reports non-determinist content model for schema

2012-02-24 Thread Pete Cordell
FWIW, the schema looks OK to me and neither Visual Studio or the W3C's XSV 
seem to report an error, so it does look like a libxml2 bug.


And I can't think of another way of expressing what you want that isn't 
truly non-deterministic.


HTH a bit!

Pete Cordell
Codalogic Ltd
Interface XML to C++ the easy way using C++ XML
data binding to convert XSD schemas to C++ classes.
Visit http://codalogic.com/lmx/ or http://www.xml2cpp.com
for more info

- Original Message - 
From: Johan Corveleyn jcor...@gmail.com

To: xml@gnome.org
Sent: Friday, February 24, 2012 1:14 PM
Subject: [xml] xmllint reports non-determinist content model for schema



Hi,

This is my first post to this list. I searched the mailing list
archives and bugzilla, but couldn't find the exact issue I'm
confronted with (if I missed something, please point me to it).

I'm running into a non-determinist error with a schema even though I
don't think it's non-determinist (and both XSV and Xerces agree with
me; they too have no problem with the schema). I have reduced my
test-case to a simple example, see below.

Given the following schema:

?xml version=1.0 encoding=UTF-8?
xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema;
xs:element name=rules
xs:complexType
xs:sequence
xs:element name=rule minOccurs=0 maxOccurs=unbounded/
xs:sequence minOccurs=0 maxOccurs=1
xs:element name=specialRule minOccurs=1 maxOccurs=1/
xs:element name=rule minOccurs=0 maxOccurs=unbounded/
/xs:sequence
/xs:sequence
/xs:complexType
/xs:element
/xs:schema

xmllint version 20708 complains with Schemas parser error : local
complex type: The content model is not determinist.

The intention is to express that there can be any number of rule
elements, and there can be at most one specialRule (at any position
in between, before, or after the rules). So the following xml's are
all valid:

?xml version=1.0 encoding=UTF-8?
rules
rule/
rule/
specialRule/
rule/
/rules

?xml version=1.0 encoding=UTF-8?
rules
specialRule/
/rules

?xml version=1.0 encoding=UTF-8?
rules
specialRule/
rule/
rule/
rule/
/rules

?xml version=1.0 encoding=UTF-8?
rules
rule/
rule/
rule/
/rules

But this one isn't (two specialRules):

?xml version=1.0 encoding=UTF-8?
rules
specialRule/
rule/
rule/
specialRule/
rule/
/rules



Is this a bug in libxml2?

And whether or not it's a bug: any workarounds? Can I write my schema
in another way to make xmllint succeed, and still express the same
constraints?

--
Johan
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml 


___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


[xml] RegEx Regression Tests

2009-09-11 Thread Pete Cordell

I'm looking at the regular expression regression tests.  In the likes of
test\regexp\ranges, how do you know which inputs should match the patterns,
and which shouldn't?

Many thanks,

Pete.
--
=
Pete Cordell
Codalogic Ltd
Interface XML to C++ the easy way using XML C++
data binding to convert XSD schemas to C++ classes.
Visit http://codalogic.com/lmx/ or http://www.xml2cpp.com
for more info
=



___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] How to bind multiple IP?

2009-07-28 Thread Pete Cordell
If you ever do find the lines of code you need, you will obviously want to 
change the following line:


addr.sin_addr.s_addr = INADDR_ANY;

to specify the particular address you want to bind to.  Presumably you will 
need some sort of algorithm to distribute your set of addresses to the 
sockets.


HTH a bit!

Pete Cordell
Codalogic Ltd
Interface XML to C++ the easy way using XML C++
data binding to convert XSD schemas to C++ classes.
Visit http://codalogic.com/lmx/ or http://www.xml2cpp.com
for more info

- Original Message - 
From: Brian Kim 09su.resea...@gmail.com

To: Michael Hanson michh...@cisco.com; xml@gnome.org
Sent: Tuesday, July 28, 2009 6:49 PM
Subject: Re: [xml] How to bind multiple IP?



Thanks.

Here is a representative sample example of binding a socket.

sd = socket(PF_INET, SOCK_DGRAM, 0);
if ( sd  0 )
{
  perror(socket);
  exit(1);
}
addr.sin_family = AF_INET;
addr.sin_port = htons(SERVER_PORT);
addr.sin_addr.s_addr = INADDR_ANY;
if ( bind(sd, (struct sockaddr*)addr, sizeof(addr))  0 )
{
  perror(bind);
  exit(1);
}

In libxml2, the sample code used an API, htmlreadfile(URL, ...).
I have checked a source code of that function, but I haven't found any
low level program part.
I think at least I have to know about socket that libxml2 uses
currently, then I can call bind(known_socket, ,,..)
However, i do not where it is.
Could you please tell me how to associate binding sockets with libxml2
library in the source level?

Thanks.


On Tue, Jul 28, 2009 at 12:47 PM, Michael Hansonmichh...@cisco.com wrote:

Brian -

That sort of thing depends on your operating system. As I understand your
question, you want to simulate multiple TCP/IP clients arriving to a 
server

from different IP addresses.

If you are on a *nix-style machine using the BSD sockets API, the system
call you want is bind. Normally you don't bind() a client socket, since
you want the OS to figure it out for you. But if you want to tell the OS
precisely which IP address to use, the bind call can associate the socket
with the address.

Best,
Michael
--
Michael Hanson - Principal Engineer, XML Engineering
michh...@cisco.com

On Jul 28, 2009, at 9:37 AM, Brian Kim wrote:


Hi. all.

There is a sample program for parsing html from entered URL. I
remember it is xmllint.c

By the way, as my testing program, I want to simulate multiple IPs
visits other websites at the same time.

By multiple IPs I mean, I am going to use a machine which has IP
aliasing set up and my test program that I

need to create will go to a differenct URL with aliased IP. As a
result, a program simulates multiple machines

access to different URLs at the same time, even though the program
runs in a machine.

Is there anybody who knows if I can implement it and how?

Thanks.
___
xml mailing list, project page http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml




___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] raw data

2008-06-11 Thread Pete Cordell

Original Message From: Daniel Veillard

On Wed, Jun 11, 2008 at 08:52:06AM +0200, K.Karamazen wrote:

What is the standard way to encode raw data into CDATA section?


 base64


And you don't actually need to wrap the base64 in a CDATA section.  Just 
make the base64 your element or attribute content.


HTH,

Pete Cordell
Codalogic
For XML C++ data binding visit http://www.codalogic.com/lmx/


___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Newline handling

2008-05-20 Thread Pete Cordell
- Original Message - 
From: Piotr Gaczkowski [EMAIL PROTECTED]

 But maybe you're right and UUEncoding could be used instead.

While it doesn't result in a more compact message, Base64 seems to be the 
more common method of encoding binary data within an XML context these days.

c.f. http://en.wikipedia.org/wiki/Uuencode and 
http://en.wikipedia.org/wiki/Base64.

HTH,

Pete Cordell
Codalogic
For XML C++ data binding visit http://www.codalogic.com/lmx/


___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Ambiguity regarding schema content and schema validation

2008-01-05 Thread Pete Cordell
According to VS2005 (and I agree with it) 1.xsd is not a valid schema.  You 
can have multiple elements with the same name in the same complex type, but 
those elements have to have the same type.

Also, I think you need to make the URIs contained in the values of your 
xmlns:tns and targetNamespace attributes the same (probably 
xmlns:tns=http://abc.com;).

Even if 1.xsd were valid, I'm not sure why either 2.xml or 3.xml might pass 
validation as there should be a minimum requirement for two b elements.

HTH,

Pete Cordell
Codalogic
Visit http://www.codalogic.com/lmx/ for XML C++ data binding
- Original Message - 
From: Nagesh [EMAIL PROTECTED]
To: xml@gnome.org
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Saturday, January 05, 2008 4:19 PM
Subject: [xml] Ambiguity regarding schema content and schema validation


 Hello,
 I am using libxml version 28. I have a query regarding parsing of
 the schema file and as well as schema validation.
 Is the attached schema (1.xsd) syntactically correct, (It is having
 more than 1 element with the same name, in the complex definition). If it 
 is
 correct; instance document (2.xml) is success but whereas the instance
 document (3.xml) is returning failure for schema validation using
 xmlSchemaValidateDoc( ).
 But for schema file, 4.xsd; in which I have interchanged the
 datatype definitions, (xs:int with xs:string and vice-versa), it returns
 success for both instance document 2.xml and 3.xml.
 Any leads will be appreciated. Thanks in advance for the reply.

 Thanks and Regards,
 Nagesh.






 ___
 xml mailing list, project page  http://xmlsoft.org/
 xml@gnome.org
 http://mail.gnome.org/mailman/listinfo/xml
 


___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] General XML Schema question

2007-12-21 Thread Pete Cordell
 Now I would like to create a rule which says for example if the user
 chose the enumerator MY_SPECIAL_TYPE_STRING than the type of Value has
 to be xsd:string. If the enumerator was MY_SPECIAL_TYPE_INTEGER than
 the type of Value should be xsd:integer. And maybe if this is even
 possible create my own type for Value.

Better places to ask this sort of question are [EMAIL PROTECTED], 
[EMAIL PROTECTED] and the comp.text.xml newsgroup.  You may have to do a 
bit of detective work to find out how to subscribe to these.

To answer your question, you can't use XML schema to do this.  (I'm not sure 
even if RelaxNG can do this.)

A more schema friendly way of do this would be to do:

xsd:complexType
  xsd:choice
xsd:element name=MY_SPECIAL_TYPE_STRING type=xsd:string/
xsd:element name=MY_SPECIAL_TYPE_INTEGER type=xsd:int/
xsd:element name=MY_SPECIAL_TYPE_OF_WHATEVER type=???/
  /xsd:choice
/xsd:complexType

Your XML instance then looks like:

MY_SPECIAL_TYPE_STRINGMyString/MY_SPECIAL_TYPE_STRING

XSD1.1 is looking at a feature where an attribute (but not an element) can 
specify constraints on the type of a child element.  This work is a way off 
yet, so I wouldn't wait for it!

HTH,

Pete Cordell
Codalogic
Visit http://www.codalogic.com/lmx/
for XML Schema to C++ data binding

- Original Message - 
From: Stefan Schulze Frielinghaus [EMAIL PROTECTED]
To: xml@gnome.org
Sent: Friday, December 21, 2007 9:08 AM
Subject: [xml] General XML Schema question


Hi,

I'm not aware of any other XML mailinglist, forum or whatever so I would
like to post my question here in the hope that someone else has an idea.

This is the scenario, an enumerator which should specify of which type a
special subset of my XML file is.

xsd:simpleType name=myType
  xsd:restriction base=xsd:string
xsd:enumeration value=MY_SPECIAL_TYPE_STRING/
xsd:enumeration value=MY_SPECIAL_TYPE_INTEGER/
xsd:enumeration value=MY_SPECIAL_TYPE_OF_WHATEVER/
  /xsd:restriction
/xsd:simpleType

and a complexType which holds the actual enumerator type and the value
itself.

xsd:complexType
  xsd:sequence
xsd:element name=Type type=myType/
xsd:element name=Value type=xsd:string/
  /xsd:sequence
/xsd:complexType

Now I would like to create a rule which says for example if the user
chose the enumerator MY_SPECIAL_TYPE_STRING than the type of Value has
to be xsd:string. If the enumerator was MY_SPECIAL_TYPE_INTEGER than
the type of Value should be xsd:integer. And maybe if this is even
possible create my own type for Value.

I'm not sure if this is even possible with XML Schema. I guess I have to
do it programmatically but I would like to hear a second opinion.

Best regards
Stefan


___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Regexp Failure

2007-12-05 Thread Pete Cordell
Hi,

I think there is a residual problem related to the bug reported below.  A 
customer of ours is trying to match an IP address using the pattern:

((1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])

which should match: 192.168.254.0 but doesn't.

I've tried the version of xmlregexp.c in 2.6.30 and the 2007-11-19 version 
included in today's libxml2-cvs-snapshot.tar.gz snapshot.

If I manually expand the effect of the {3} as below, then the pattern 
matches OK.

((1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\.)((1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\.)((1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\.)(1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])

Also, if I change the pattern to: (i.e. {3} - {3,4}):

((1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\.){3,4}(1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])

that matches OK as well.

I've tried to reduce the expression to find out where the problem is. 
Interesting I've found that flipping the order around of the expressions 
makes it work.  i.e. when I move the 1?... part to be the last | expression 
the pattern matches OK!:

((2[0-4][0-9]|25[0-5]|1?[0-9]{1,2})\.){3}(1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])

I hope that gives some insight into the problem.

Thanks,

Pete Cordell
Codalogic
Visit http://www.codalogic.com/lmx/
for XML Schema to C++ data binding

- Original Message - 
From: Daniel Veillard [EMAIL PROTECTED]
To: Ashwin [EMAIL PROTECTED]
Cc: xml@gnome.org; [EMAIL PROTECTED]
Sent: Wednesday, August 22, 2007 4:43 PM
Subject: Re: [xml] Regexp Failure


 On Mon, Aug 20, 2007 at 06:32:43PM +0530, Ashwin wrote:

Hi,

   I  think  the  problem  occurs when we have the minimum range as 0,
otherwise  it  works fine. I suppose the problem lies somewhere in the
generation  of epsilon states when the minimum range is zero (There is
a  separate bit of code for precisely that condition which I am trying
to work out at present:) ) Any pointers

Thanks!!

  Yes this was related to minimum range 0, and also to a problematic
 epsilon transition, but the fix required to changes parts of the graph
 generation.

 Daniel

 -- 
 Red Hat Virtualization group http://redhat.com/virtualization/
 Daniel Veillard  | virtualization library  http://libvirt.org/
 [EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
 http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/
 ___
 xml mailing list, project page  http://xmlsoft.org/
 xml@gnome.org
 http://mail.gnome.org/mailman/listinfo/xml
 


___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] XMLSchema status?

2007-02-20 Thread Pete Cordell
Original Message From: John Calcote

 Daniel or anyone else? Can you tell me the status of the XMLSchema
 library?
 I wonder how mature it is at this point. Can it be used to validate a
 document yet?

In general most processors don't support 100% of schema features.  If you
have a particular set of schemas that you want to use in mind then the best
thing might be to test that and various valid and non-valid XML instances
and see what the results are.  Obviously this strategy won't help if you
expect the sets of schemas that you use to change rapidly.

In other words, some missing features may not actually be a problem for you. 
(But then again, they may be!)

HTH,

Pete.
--
=
Pete Cordell
Tech-Know-Ware Ltd
for XML to C++ data binding visit
http://www.tech-know-ware.com/lmx
(or http://www.xml2cpp.com)
=


___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] xmlSchemaValidateDoc

2007-02-13 Thread Pete Cordell
Original Message From: Andreas Tscharner
 Original Message From: Suresh Chandak

1. Do we need to have the elements in the same order in
 xml as xsd ?

 Yes, as long as you define xs:sequence in your XSD the elements have
 to be in the same order in the XML as in your XSD.
...
 If you want to add the elements in no specific order, have a look at
 xs:all which you can use instead of xs:sequence in you XSD. But be
 careful xs:all cannot be used as a replacement of xs:sequence, there
 are some restrictions. The XSD book/page/reference (I use XML Schema
 from O'Reilly) of your choice describes it in detail...

Just to add a bit more detail, the main limitation of xs:all is that 
minOccurs and maxOccurs are restricted to be either 0 or 1.  Also, xs:any 
style wildcards are not allowed, nor can xs:all be or have anonymous 
compositors.  And it can't be used in extension scenarios.  Hence it might 
be a bit limiting for your needs.  (BTW - some of these limitations maybe 
relaxed in XSD 1.1, but I wouldn't wait for that to come along!)

I'd also recommend the book Andreas mentioned:
http://www.amazon.com/XML-Schema-Eric-Van-Vlist/dp/0596002521/

Although, some reviewers seem to think it's not the best text to start with.

HTH,

Pete.
--
=
Pete Cordell
Tech-Know-Ware Ltd
for XML to C++ data binding visit
http://www.tech-know-ware.com/lmx
(or http://www.xml2cpp.com)
= 


___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Tool to help fill in structures from XML

2007-01-24 Thread Pete Cordell
Hi David,

 Does anybody know of a good tool which takes the drudgery out of reading
 XML into structures?

FYI - We have a tool that takes an XML Schema, and generates C++ classes 
with all the marshalling and unmarshalling machinery.  For more info, see:

http://www.tech-know-ware.com/lmx

However, my take of your example (below) is slightly different from your 
descriptive question.  If your example is closer to what you want, the Boost 
library has an object serialization component.  You may not get the exact 
XML that you are looking for, and it might involve a little drudgery, but it 
might help.

HTH,

Pete.

 Specifically, what I'd like would be a tool that allows me to describe an
 XML grammar (e.g. via RelaxNG) and a structure layout, and then generate
 tables or code that would read an XML file and store the incoming elements
 into objects in C++.

 e.g. given

 struct some_struct
 {
   int a;
   int b:4;
   enum {larry,moe,curly} stooge;
 };

 parse
 some_struct a=5
   b4/b
   stooge which=moe/
 /some_struct

 and give me a filled-in some_struct object. Obviously, there would have to
 be some other file which mapped the XML entities into the structure (and
 vis-versa) - ideally some XML file which, when chewed upon by the proper
 tool, would spit out C++ code and a RelaxNG schema.

 Does anybody know of such a tool?
--
=
Pete Cordell
Tech-Know-Ware Ltd
for XML to C++ data binding visit
http://www.tech-know-ware.com/lmx
(or http://www.xml2cpp.com)
=


___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml