[Thread Prev][Thread Next][Index]

Re: Includes in LAS xml files



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 category file th
at (partially) looks like:

(file is Insitu_Datasets.xml)
<category name="Insitu">

<category name="Surface">

<category name="CAMP_Mongolia">
<category name="BTS">
<filter action="apply-dataset" equals="CEOP Surface Mongolia BTS"/>
</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="Insitu/CAMP_Mongolia_20021001_20030331sfc.data"
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 will appear in about 100 different menu pages (and therefore in about 100 differe
nt xml files, one for each location) for several locations and stations with
in locations. I want to make this line an xml file/xml include so that, if I want to change the text of the menu item, I only change it in the one xml file, and not 100 xml files. In other words, I want to create the xml file Var_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 line to &VarNameStationPressure; as I show just above. I also tried putting the following 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="Station Pressure" units="hPa (mb)"> ) in a separate xml file and then put it into CE
OP_Insitu_Surface_Mongolia_DGS.xml as an xml include?

If anyone has an existing xml file(s) as an example that you can send me as attached files, that would be the ideal and easy way to explain.

Thanks very much,

Ben





[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement