[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[THREDDS #TMB-757245]: XML parser error: Invalid content was found starting with element 'variable'. No child element is expected at this point.



Hi Rich,

The NcML XML Schema says that all "variable" elements must come before any 
"aggregation" element. So, the quickest fix would be to modify your XML so the 
"variable" elements come before the "aggregation" element.

Another possible option ... I'm guessing the code that interprets the NcML 
doesn't really care about the order. There may be a way to turn off XML 
validation but it depends on the app you are using. Is this happening in the 
TDS?

Ethan

> Why do I get this error:
> 
> readCatalog(): valid catalog -- ----Catalog Validation version 1.0.01
> *** XML parser error (24:36)= cvc-complex-type.2.4.d: Invalid content
> was found starting with element 'variable'. No child element is
> expected at this point.
> 
> with this catalog:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <catalog name="UNH Water Balance Model Catalog"
> xmlns="http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0";
> xmlns:xlink="http://www.w3.org/1999/xlink";>
> 
> <service name="allServices" base="" serviceType="compound">
> <service name="dapService" serviceType="OpenDAP" base="/thredds/dodsC/"/>
> </service>
> 
> <dataset name="UNH Water Balance Models">
> <metadata inherited="true">
> <serviceName>allServices</serviceName>
> <dataType>Grid</dataType>
> <dataFormat>NetCDF</dataFormat>
> </metadata>
> <dataset name="pWBM_9km" ID="wbm/pWBM_9km" urlPath="wbm/pWBM_9km">
> <netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2";>
> <aggregation dimName="time" type="joinNew" recheckEvery="5 min">
> <variableAgg name="Discharge"/>
> <variableAgg name="Runoff"/>
> <scan location="C:/RPS/cf/unh/wbm/" dateFormatMark="wbm.#yyyy.MM.dd"
> regExp=".*wbm\.[0-9]{4}\.[0-9]{2}\.[0-9]{2}\.nc$" subdirs="false"/>
> </aggregation>
> <variable name="Discharge">
> <attribute name="coordinates" value="Longitude Latitude"/>
> </variable>
> <variable name="Runoff">
> <attribute name="coordinates" value="Longitude Latitude"/>
> </variable>
> </netcdf>
> </dataset>
> </dataset>
> </catalog>


Ticket Details
===================
Ticket ID: TMB-757245
Department: Support THREDDS
Priority: Normal
Status: Closed