Ben, With the current XML specification you can define a single grid that can be referenced by multiple variables. For folks running models on the same grid this can be useful. In your case, each grid is unique to a specific longitude and latitude so you must create and reference a separate grid for each dataset. For Ferret (the LAS back end) to work, each variable must be identified with a grid. What you really want to do is associate the <grid> at the <dataset> level rather than at the <variable> level. Then all your <variables> XML code would look the same in each file because they would inherit the unique grid specified at the <dataset> level. This kind of inheritance works automatically for things like <properties> but we've never tried it out with the <link match=...).. I doubt this will work in the current incarnation of our XML parsing but you can try the following: move <link match= ...> line up to make it a an element of the <insitu_Surface_Mongolia_DGS ...> (at the same level as the <properties> defined there). Then remove the <link match=...> lines from all the <variables>. In the best of all possible worlds your variables will inherit this information and your problem will be solved. Otherwise you'll have to write some scripts to automatically generate the unique XML files you need (a straightforward, if unwelcome task). -- Jon Ben Burford wrote: Hello Jean-Marie, I tried you idea and it works! However, it negates what I'm trying to accom plish!! I don't want to include the second line ( <link match="/lasdata/grids/DGS_XY ZT_grid"/> ) in the xml include file, because it has to be unique for each file. I have about 200 sets of automated weather station time series data f rom different locations. This will result in my creating 200 files like CEO P_Insitu_Surface_Mongolia_DGS.xml all of which have the same set of 19 vari ables (e.g. Air_Temperature), but all of which have a different station name (i.e. the "DGS" part, and all have a different lat/lon location). The stru cture of my CEOP_Insitu_Surface_Mongolia_DGS.xml file looks like this: <datasets> <Insitu_Surface_Mongolia_DGS name="CEOP Surface Mongolia DGS" url="" doc=""> <properties> (stuff deleted) </properties> <variables> <Air_Temperature name="Air Temperature" units="Celsius"> <link match="/lasdata/grids/DGS_XYZT_grid"/> </Air_Temperature> <Dew_Point_Temperature name="Dew Point Temperature" units="Celsius"> <link match="/lasdata/grids/DGS_XYZT_grid"/> </Dew_Point_Temperature> (etc., continues for a total of 19 variables) </variables> </Insitu_Surface_Mongolia_DGS> </datasets> <grids> <DGS_XYZT_grid> <link match="/lasdata/axes/DGS_X"/> <link match="/lasdata/axes/DGS_Y"/> <link match="/lasdata/axes/DGS_T"/> </DGS_XYZT_grid> </grids> <axes> <DGS_X units="degree_east" type="x"> <arange start="106.369" step="1" size="1"/> </DGS_X> <DGS_Y units="degree_north" type="y"> <arange start="46.1273" step="1" size="1"/> </DGS_Y> <DGS_T units="hours" type="t"> <arange start="2002-Oct-01 01:00:00" step="1" size="48"/> </DGS_T> </axes> The structure "DGS_ . . ." (shown in these next lines): <link match="/lasdata/grids/DGS_XYZT_grid"/> <DGS_XYZT_grid> <link match="/lasdata/axes/DGS_X"/> <link match="/lasdata/axes/DGS_Y"/> <link match="/lasdata/axes/DGS_T"/> </DGS_XYZT_grid> <DGS_X units="degree_east" type="x"> </DGS_X> <DGS_Y units="degree_north" type="y"> </DGS_Y> <DGS_T units="hours" type="t"> </DGS_T> The structure "DGS_ . . ." has to be unique in each of the 200 files. So if my include includes all three lines, i.e. if &InsituAirTemperature; includ es: <Air_Temperature name="Air Temperature" units="Celsius"> <link match="/lasdata/grids/DGS_XYZT_grid"/> </Air_Temperature> then the "DGS_XYZT" part is repeated, and xml doesn't allow repeats of this in the 200 files. I want a single copy of the following line identical/repeated in 200 files: <Air_Temperature name="Air Temperature" units="Celsius"> but I can't have the second line repeated at all: <link match="/lasdata/grids/DGS_XYZT_grid"/> I may be stuck with an unfriendly structure. Does anybody see any solutions? Thank you, Ben At 09:11 2004/10/07 +0200, you wrote:Ben, yes, I believe I can see what is wrong... I guess that the entity you include should contain a valid start tag matched witha valid end tag. In your example, file Insitu_Air_Temperature.xml should contain all the threelines: <Station_Pressure name="Station Pressure" units="hPa (mb)"> <link match="/lasdata/grids/DGS_XYZT_grid"/> </Station_Pressure> matching <Station_Pressure ...> start tag with </Station_Pressure> Did you try that ? Jean-Marie Epitalon Ben Burford wrote:Hi Joe, Thanks, but it didn't work. I hope someone can spot a problem (like maybe amissing semicolon). Here are the details: I modified my las.xml file as follows: <?xml version='1.0' ?> <!DOCTYPE spec SYSTEM "spec.dtd" [ <!-- Declaration of operations files to be included --> <!ENTITY StdOperations SYSTEM "operations.xml"> <!ENTITY insitu_operations SYSTEM "insitu_operations.xml"> <!-- Declaration of dataset files to be included --> <!ENTITY InsituDatasets SYSTEM "Insitu_Datasets.xml"> (note: this next item was already in the las.xml file) <!-- Declaration of variables files to be included --> <!ENTITY CEOP_Insitu_Surface_Mongolia_DGS SYSTEM "CEOP_Insitu_Surface_Mongolia_DGS.xml"> (note: I added this next item to the xml.file) <!-- Declaration of variable names files to be included --> <!ENTITY InsituAirTemperature SYSTEM "Insitu_Air_Temperature.xml"> ]> <lasdata> <las_categories> &InsituDatasets; </las_categories> (note: other stuff deleted) (note: this next line was already in las.xml) <!-- Datasets provided by this server --> &CEOP_Insitu_Surface_Mongolia_DGS; </lasdata> Next, I created a new xml file Insitu_Air_Temperature.xml containing this one line: <Station_Pressure name="Station Pressure" units="hPa (mb)"> Next, I modified the file CEOP_Insitu_Surface_Mongolia_DGS.xml as follows. First, the original version: <datasets> <Insitu_Surface_Mongolia_DGS name="CEOP Surface Mongolia DGS" url="" doc=""> (note: other stuff deleted) <variables> <Station_Pressure name="Station Pressure" units="hPa (mb)"> <link match="/lasdata/grids/DGS_XYZT_grid"/> </Station_Pressure> I modified this file by replacing one line in the variables section as follows: <variables> &InsituAirTemperature; <link match="/lasdata/grids/DGS_XYZT_grid"/> </Station_Pressure> The error message that I got from the make was: asynchronous entity at line 2, column 0, byte 63: <Station_Pressure name="Station Pressure" units="hPa (mb)"> ^ error in processing external entity reference at line 32, column 3, byte901:<variables> &InsituAirTemperature; ==^ <link match="/lasdata/grids/DGS_XYZT_grid"/> </Station_Pressure> error in processing external entity reference at line 53, column 0, byte1649:<!-- Datasets provided by this server --> ^ &CEOP_Insitu_Surface_Mongolia_DRS; at /usr/lib/perl5/site_perl/5.6.0/i386-linux/XML/Parser.pm line 185 make: *** [../ui/config.js] Error 255 What does "asynchronous entity" mean in this case? After this I tried one more thing. I added &InsituAirTemperature; to las.xml as follows: <!-- Datasets provided by this server --> &CEOP_Insitu_Surface_Mongolia_DGS; &InsituAirTemperature; </lasdata> But I got exactly the same error message. Does anyone see anything wrong? Thanks, Ben At 15:13 2004/10/06 -0700, you wrote:Hi Ben, I have no example for you at the moment, but I have an explanation which I think will help. XML ENTITIES are declared in the DOCTYPE definition which must be declared before the first element in the XML document. Therefore all ENTITIES must be declared in your root document which by default is las.xml (the first xml element in the las.xml file is <lasdata>)Once it is declared there, then you can use the reference anywhere within the document i.e. these two Entities are declared in the las.xml DOCTYPE definition ----------------------------- <?xml version='1.0' ?> <!DOCTYPE spec SYSTEM "spec.dtd" [ <!-- Declaration of dataset files to be included --> <!ENTITY ceop_surf_mong_dgs SYSTEM "CEOP_Insitu_Surface_Mongolia_DGS.xml"><!-- Other Entities --> <!ENTITY VarNameStationPressure SYSTEM "Var_Name_Station_Pressure.xml"> ]> <lasdata> [...] ------------------------------ now you can use "&ceop_surf_mong_dgs;" as a reference in the las.xml document and you can use "&VarNameStationPressure;" in the las.xml document or in CEOP_Insitu_Surface_Mongolia_DGS.xml. Hope this helps. Joe ------------------------------------- Ben Burford wrote:Hello All, I'm a beginner at XML and I'm building LAS menus. I have a categoryfilethat (partially) looks like: (file is Insitu_Datasets.xml) <category name="Insitu"> <category name="Surface"> <category name="CAMP_Mongolia"> <category name="BTS"> <filter action="" equals="CEOP Surface MongoliaBTS"/></category> (this leads to the file CEOP_Insitu_Surface_Mongolia_DGS.xml which contains)<datasets> <Insitu_Surface_Mongolia_DGS name="CEOP Surface Mongolia DGS" url="" doc=""> <properties> (properties stuff not important) </properties> <variables> <Station_Pressure name="Station Pressure" units="hPa (mb)"> <link match="/lasdata/grids/DGS_XYZT_grid"/> </Station_Pressure> (etc. for more variables, then grids then axes). In this line: <Station_Pressure name="Station Pressure" units="hPa (mb)"> Station Pressure will appear as a menu entry. This list of variables willappear in about 100 different menu pages (and therefore in about 100different xml files, one for each location) for several locations and stations within locations. I want to make this line an xml file/xml include so that,ifI want to change the text of the menu item, I only change it in the one xmlfile, and not 100 xml files. In other words, I want to create the xml fileVar_Name_Station_Pressure.xml which would contain one line: <Station_Pressure name="Station Pressure" units="hPa (mb)"> and then in CEOP_Insitu_Surface_Mongolia_DGS.xml put &VarNameStationPressure; as in: <variables> &VarNameStationPressure; <link match="/lasdata/grids/DGS_XYZT_grid"/> </Station_Pressure> so the 1 line would be substituted. I created the xml file Var_Name_Station_Pressure.xml and changed my original xml file by changing the one lineto&VarNameStationPressure; as I show just above. I also tried putting thefollowing at the beginning of the CEOP_Insitu_Surface_Mongolia_DGS.xml file:<?xml version='1.0' ?> <!DOCTYPE spec SYSTEM "spec.dtd" [ <!ENTITY VarNameStationPressure SYSTEM "Var_Name_Station_Pressure.xml"> ]> So, is it possible to put this one line ( <Station_Pressure name="StationPressure" units="hPa (mb)"> ) in a separate xml file and then put itintoCEOP_Insitu_Surface_Mongolia_DGS.xml as an xml include? If anyone has an existing xml file(s) as an example that you can sendmeasattached files, that would be the ideal and easy way to explain. Thanks very much, Ben |