validating sample xml data

147 views
Skip to first unread message

Linda F-G

unread,
Sep 30, 2013, 5:32:51 PM9/30/13
to energy...@googlegroups.com
I am trying to use the sample data located at www.greenbuttondata.org/greendevelop.aspx.  I have downloaded the 12MonthlyUpdates.xml and am now trying to validate that file against the espi.xsd schema.  When I try to do so, I get the errors that you see below.  I am confused as to why the sample data does not validate.  Can you explain this?  I have attached the 12monthlyUpdates.xml file that I am using in case you are not familiar with it.  I'm just getting started with this, so am hoping that someone is actually monitoring this group.  Thanks in advance.

Linda

ERROR: The 'http://naesb.org/espi:currency' element is invalid - The value '840'
 is invalid according to its datatype 'http://naesb.org/espi:CurrencyCode' - The
 string '840' is not a valid Byte value.
ERROR: The 'http://naesb.org/espi:currency' element is invalid - The value '840'
 is invalid according to its datatype 'http://naesb.org/espi:CurrencyCode' - The
 string '840' is not a valid Byte value.
ERROR: The element 'ElectricPowerUsageSummary' in namespace 'http://naesb.org/espi' has invalid child element 'overallConsumptionLastPeriod' in namespace 'http://naesb.org/espi'. List of possible elements expected: 'currentBillingPeriodOverAllConsumption, currentDayLastYearNetConsumption, currentDayNetConsumption, currentDayOverallConsumption, peakDemand, previousDayLastYearOverallConsumption, previousDayNetConsumption, previousDayOverallConsumption, qualityOfReading, ratchetDemand, ratchetDemandPeriod, statusTimeStamp' in namespace 'http://naesb.org/espi'.



12MonthlyUpdates.xml

Marty Burns

unread,
Sep 30, 2013, 5:48:03 PM9/30/13
to energy...@googlegroups.com

Linda,

 

You are using the espi.xsd which has errors. We will be updating that schema through the standards process this fall/winter.

 

The current schema which has all fixes and lessons learned since the start of Green Button can be found at: https://github.com/energyos/OpenESPI-DataCustodian-java/tree/master/etc

 

Let us know how you make out.

 

Cheers,

Marty

--
--
You received this message because you are subscribed to the "energyos_espi" group.
To post to this group, send email to energy...@googlegroups.com
To unsubscribe from this group, send email to: energyos_esp...@googlegroups.com
 
http://www.energyos.org/espi/
 
---
You received this message because you are subscribed to the Google Groups "energyos_espi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to energyos_esp...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Linda F-G

unread,
Oct 1, 2013, 3:23:34 PM10/1/13
to energy...@googlegroups.com
Marty,

Thanks for your reply.  I've gotten a little further now and downloaded the atom.xsd and espiderived from github.  However, my validation code seems to be having trouble with atom.xsd at line 236 with the base reference.  (Exception below.)  I should note that I'm trying this in .net.  Do you or any others have any idea what's wrong.  I've pretty much tried every which way to validate it and all attempts have been unsuccessful
Thanks,

Linda

System.Xml.Schema.XmlSchemaValidationException was unhandled
  HResult=-2146231999
  Message=The 'http://www.w3.org/XML/1998/namespace:base' attribute is not declared.
  Source=System.Xml
  LineNumber=236
  LinePosition=4
  SourceUri=file:///C:/junk/ConsoleApplication1/ConsoleApplication1/bin/Debug/atom.xsd
  StackTrace:
       at System.Xml.Schema.XmlSchemaValidator.SendValidationEvent(XmlSchemaValidationException e, XmlSeverityType severity)
       at System.Xml.Schema.XmlSchemaValidator.SendValidationEvent(XmlSchemaException e)
       at System.Xml.Schema.XmlSchemaValidator.RecompileSchemaSet()
       at System.Xml.Schema.XmlSchemaValidator.Init()
       at System.Xml.Schema.XmlSchemaValidator..ctor(XmlNameTable nameTable, XmlSchemaSet schemas, IXmlNamespaceResolver namespaceResolver, XmlSchemaValidationFlags validationFlags)
       at System.Xml.XsdValidatingReader.SetupValidator(XmlReaderSettings readerSettings, XmlReader reader, XmlSchemaObject partialValidationType)
       at System.Xml.XsdValidatingReader..ctor(XmlReader reader, XmlResolver xmlResolver, XmlReaderSettings readerSettings, XmlSchemaObject partialValidationType)
       at System.Xml.XmlReaderSettings.AddValidation(XmlReader reader)
       at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
       at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings, XmlParserContext inputContext)
       at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings)
       at ConsoleApplication1.Program.Main(String[] args) in c:\junk\ConsoleApplication1\ConsoleApplication1\Program.cs:line 39
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:

System.Xml.Schema.XmlSchemaValidationException was unhandled
  HResult=-2146231999
  Message=The 'http://www.w3.org/XML/1998/namespace:base' attribute is not declared.
  Source=System.Xml
  LineNumber=236
  LinePosition=4
  SourceUri=file:///C:/junk/ConsoleApplication1/ConsoleApplication1/bin/Debug/atom.xsd
  StackTrace:
       at System.Xml.Schema.XmlSchemaValidator.SendValidationEvent(XmlSchemaValidationException e, XmlSeverityType severity)
       at System.Xml.Schema.XmlSchemaValidator.SendValidationEvent(XmlSchemaException e)
       at System.Xml.Schema.XmlSchemaValidator.RecompileSchemaSet()
       at System.Xml.Schema.XmlSchemaValidator.Init()
       at System.Xml.Schema.XmlSchemaValidator..ctor(XmlNameTable nameTable, XmlSchemaSet schemas, IXmlNamespaceResolver namespaceResolver, XmlSchemaValidationFlags validationFlags)
       at System.Xml.XsdValidatingReader.SetupValidator(XmlReaderSettings readerSettings, XmlReader reader, XmlSchemaObject partialValidationType)
       at System.Xml.XsdValidatingReader..ctor(XmlReader reader, XmlResolver xmlResolver, XmlReaderSettings readerSettings, XmlSchemaObject partialValidationType)
       at System.Xml.XmlReaderSettings.AddValidation(XmlReader reader)
       at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
       at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings, XmlParserContext inputContext)
       at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings)
       at ConsoleApplication1.Program.Main(String[] args) in c:\junk\ConsoleApplication1\ConsoleApplication1\Program.cs:line 39
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:

Linda F-G

unread,
Oct 1, 2013, 3:40:52 PM10/1/13
to energy...@googlegroups.com
Figured, just as I posted this I figured out the issue.  Because atom.xsd was referencing a base namespace, I needed to load that one first in my schema collection to prevent that error.

Scott Crowder

unread,
Oct 1, 2013, 10:08:41 PM10/1/13
to energy...@googlegroups.com
What is located at line 236 position 4 in your test file?


Scott Crowder

unread,
Oct 1, 2013, 10:09:48 PM10/1/13
to energy...@googlegroups.com
Linda:
I use .NET for xml processing.  Can you send me your code and I'll take a look also send the test file you are using

Thanks
Scott Crowder


Marty Burns

unread,
Oct 2, 2013, 4:31:24 AM10/2/13
to energy...@googlegroups.com

So I take it you are good to go? /marty

 

From: energy...@googlegroups.com [mailto:energy...@googlegroups.com] On Behalf Of Linda F-G


Sent: Tuesday, October 01, 2013 9:41 PM
To: energy...@googlegroups.com

Linda F-G

unread,
Oct 2, 2013, 9:13:45 AM10/2/13
to energy...@googlegroups.com
Yes, all set.  Thanks everyone for your responses.
Reply all
Reply to author
Forward
0 new messages