Search found 9 matches

by daddyjones
Thu May 10, 2018 5:34 pm
Forum: XML Schemas
Topic: Limit the value of an element based on existing XML data
Replies: 5
Views: 1638

Re: Limit the value of an element based on existing XML data

Or XInclude? I think I could use XInclude to include an XML fragment - which might do, although I'm struggling to figure out how to get Oxygen to work with this...
by daddyjones
Thu May 10, 2018 4:44 pm
Forum: XML Schemas
Topic: Limit the value of an element based on existing XML data
Replies: 5
Views: 1638

Re: Limit the value of an element based on existing XML data

Could XPointer be used to achieve this?
by daddyjones
Thu May 10, 2018 4:42 pm
Forum: XML Schemas
Topic: Limit the value of an element based on existing XML data
Replies: 5
Views: 1638

Re: Limit the value of an element based on existing XML data

thanks for the reply - so there's no way of doing this built into XML Schema itself? Would most standard parsers be able to validate based on both XML Schema and Schematron?
by daddyjones
Thu May 03, 2018 4:34 pm
Forum: XML Schemas
Topic: Limit the value of an element based on existing XML data
Replies: 5
Views: 1638

Limit the value of an element based on existing XML data

I'm fairly sure what I want to do can't be done, but I thought I'd ask on here just in case. If I have the following XML: <foo> <bar name="lorem" /> <bar name="ipsum" /> <bar name="dolor" /> <bar name="sit" /> ... </foo> Is it possible, in XML Schema to restrict a new element to the existing values ...
by daddyjones
Thu Apr 19, 2018 6:57 pm
Forum: XML Schemas
Topic: Include default values in Schema for XPath query
Replies: 6
Views: 1649

Re: Include default values in Schema for XPath query

Interestingly, if I use the person sample I get the same results as you. I'm using version 20.0 build 2018032903 and the xsd is in the same directory as the xml. The XPath I'm using is: //rf:mob[@minDepth <=2] and there are two elements without a minDepth attribute - which the schema defines as havi...
by daddyjones
Thu Apr 19, 2018 4:39 pm
Forum: XML Schemas
Topic: Include default values in Schema for XPath query
Replies: 6
Views: 1649

Re: Include default values in Schema for XPath query

That doesn't seem to make any difference. I am referring to the schema in the XML with:

Code: Select all

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.redfruit.co.uk/libgdx/wobbegong mobs.xsd"
I've tried with both 2.0 SA and 3.0 SA
by daddyjones
Wed Apr 18, 2018 5:25 pm
Forum: XML Schemas
Topic: Include default values in Schema for XPath query
Replies: 6
Views: 1649

Include default values in Schema for XPath query

If an attribute is specified in my Schema as having a default value, is there a way to get the XPath query to include that value in the results? At present, my program code (which includes validation) returns 6 results from a given query, but Oxygen only returns 4 because the missing two don't have ...
by daddyjones
Wed Apr 18, 2018 5:22 pm
Forum: XML Schemas
Topic: Is there a way to specify a range as a data type
Replies: 2
Views: 1165

Re: Is there a way to specify a range as a data type

Thanks. In case anyone is googling this in future and finds this thread - I've gone with:

Code: Select all

<xs:pattern value="[123456789]\d*-[123456789]\d*"/>
by daddyjones
Wed Apr 11, 2018 4:47 pm
Forum: XML Schemas
Topic: Is there a way to specify a range as a data type
Replies: 2
Views: 1165

Is there a way to specify a range as a data type

I have an attribute that I'd like to have a range of values as it's data type. By which I don't mean: a number between x and y, but more like x-y For example <myelement myattribute="7-10" /> or <myelement myattribute="14-240" /> I'm guessing I might have to use a regular expression for this, but I w...