On May 8, 2006, at 4:46 PM, Matthew Soffen wrote: OK. My Bad. Yes. It does work to validate properly ( Had a typo in my xsd ). > xmllint --schema LRPMeteringData.xsd event_summary_20050629025529.xml <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?> <LRPSummaryData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="LRPMeteringData.xsd" CreateTime="2005-06-29T02:55:31"> <Event EventID="10876" LoadZoneID="4004" Program="PRICE" StartTimeStamp="2005-06-29T16:00:00" EndTimeStamp="2005-06-29T22:00:00" NoticeType="Notice"/> <Event EventID="10877" LoadZoneID="4008" Program="PRICE" StartTimeStamp="2005-06-29T16:00:00" EndTimeStamp="2005-06-29T22:00:00" NoticeType="Notice"/> </LRPSummaryData> event_summary_20050629025529.xml validates So XSD could be an option.
looks a lot more flexible, writing one now :) thanks for the tip! Matt On Mon, 2006-05-08 at 15:52 +0200, Andrew Beekhof wrote: do you know what can we use to validate xml against it? i dont see xsd in xmllint On May 8, 2006, at 3:45 PM, Matthew Soffen wrote: Correction: My Bad. I meant XSD ( XML Schema Definition). This is an example of one I wrote for something at ISO. It allows you to define how many of a field may exist, if it is required or not. Its pretty flexible ( at least I think). Matt <?xml version="1.0" encoding="ISO-8859-1" ?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xsd:element name="LRPMeteringData"> <xsd:complexType> <xsd:sequence minOccurs="0" maxOccurs="unbounded"> <xsd:element name="Event" type="EventType"/> </xsd:sequence> <xsd:attribute name="Component" type="ComponentType" use="required"/> <xsd:attribute name="FileType" type="FileTypeType" use="required"/> <xsd:attribute name="CreateTime" type="xsd:dateTime" use="required"/> </xsd:complexType> </xsd:element> <xsd:element name="LRPSummaryData"> <xsd:complexType> <xsd:sequence minOccurs="0" maxOccurs="unbounded"> <xsd:element name="Event" type="EventSummaryType" /> </xsd:sequence> <xsd:attribute name="CreateTime" type="xsd:dateTime" use="required"/> </xsd:complexType> </xsd:element> <xsd:element name="MeterReaders"> <xsd:complexType> <xsd:sequence minOccurs="0" maxOccurs="unbounded"> <xsd:element name="MeterReader" type="MeterReaderType"/> </xsd:sequence> <xsd:attribute name="EffectiveDate" type="xsd:date" use="required"/> </xsd:complexType> </xsd:element> <xsd:complexType name="ContactType"> <xsd:sequence> <xsd:element name="FirstName" type="xsd:string"/> <xsd:element name="LastName" type="xsd:string"/> <xsd:element name="Phone" type="xsd:positiveInteger" minOccurs="0"/> <xsd:element name="PhoneExt" type="xsd:positiveInteger" minOccurs="0"/> <xsd:element name="Fax" type="xsd:positiveInteger" minOccurs="0"/> <xsd:element name="Email" type="xsd:string" minOccurs="0"/> <xsd:element name="Pager" type="xsd:string" minOccurs="0"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="MeterReaderType"> <xsd:sequence> <xsd:element name="CustomerID" type="xsd:positiveInteger"/> <xsd:element name="Name" type="xsd:string"/> <xsd:element name="IbcsProvider" type="YNType"/> <xsd:sequence minOccurs="0" maxOccurs="unbounded"> <xsd:element name="Contact" type="ContactType"/> </xsd:sequence> </xsd:sequence> </xsd:complexType> On Mon, 2006-05-08 at 15:42 +0200, Andrew Beekhof wrote: On 5/8/06, Matthew Soffen <[EMAIL PROTECTED]> wrote:
> Has using an XSL been considered instead of a DTD ?
>
> Matt
my understanding is that XSL will let you transform XML from one
"format" to another.
but that doesn't do validation as far as i can tell.
btw. were the extra changes to bootstrap ok for you?
I tried to email you directly but it bounced.
> On Mon, 2006-05-08 at 15:00 +0200, Andrew Beekhof wrote:
> On May 8, 2006, at 2:44 PM, Lars Marowsky-Bree wrote:
>
> > On 2006-05-08T14:16:15, Andrew Beekhof <[EMAIL PROTECTED]> wrote:
> >
> >>> Good point.
> >> we also need to find a way to have it ignore the order things appear
> >> in... thats going to be a major PITA
> >
> > You mean within the CIB? Well, the order is defined, doesn't matter
> > too
> > much, or does it?
>
> the problem is when you replace things (normally by removing the old
> and adding the new) you can affect the order things in the CIB occur in.
>
> the CIB doesn't care, but the DTD will and if you have dtd validation
> turned on...
>
> So instead of:
>
> <!ELEMENT configuration (nodes, resources, constraints, metadata,
> crm_config)>
>
> You need:
>
> <!ELEMENT configuration
> (nodes|resources|constraints|metadata|
> crm_config)+>
>
> Which no longer ensures you have exactly one of each.
>
> I just finished reading a thread from 2000 where this problem was
> discussed and the response was "tough luck".
> It appears nothing has changed in the last 6 years.
>
> --
> Andrew Beekhof
>
> "Too much knowledge leads to confusion; Too many guitar lessons lead
> to jazz-fusion!" - TISM
>
>
>
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
>
>
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
>
>
>
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/
_______________________________________________________ Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev Home Page: http://linux-ha.org/ -- Andrew Beekhof “The greatest trick the devil ever pulled was convincing the world he didn’t exist.” - The Usual Suspects _______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/
_______________________________________________________
-- Andrew Beekhof
"I like your old stuff better than your new stuff" - Regurgitator
|
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/