Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Xml-light:
- $ rlwrap ocaml
- OCaml version 4.01.0
- # #use "topfind";;
- - : unit = ()
- # #require "xml-light";;
- /home/obd/.opam/4.01.0/lib/xml-light: added to search path
- /home/obd/.opam/4.01.0/lib/xml-light/xml-light.cma: loaded
- # Xml.parse_file;;
- - : string -> Xml.xml = <fun>
- # Xml.parse_file "/tmp/foo.xml";;
- - : Xml.xml =
- Xml.Element
- ("hdf5:HDF5-File",
- [("xmlns:hdf5", "http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd");
- ("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
- ("xsi:schemaLocation",
- "http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd")],
- [Xml.Element
- ("hdf5:RootGroup", [("OBJ-XID", "xid_96"); ("H5Path", "/")],
- [Xml.Element
- ("hdf5:Group",
- [("Name", "AerosolResults"); ("OBJ-XID", "xid_45088");
- ("H5Path", "/AerosolResults"); ("Parents", "xid_96");
- ("H5ParentPaths", "/")],
- [Xml.Element
- ("hdf5:Dataset",
- [("Name", "aerosol_1_aod"); ("OBJ-XID", "xid_58080");
- ("H5Path", "/AerosolResults/aerosol_1_aod");
- ("Parents", "xid_45088"); ("H5ParentPaths", "/AerosolResults")],
- [Xml.Element
- ("hdf5:StorageLayout", [],
- [Xml.Element
- ("hdf5:ChunkedLayout", [("Ndims", "1")],
- [Xml.Element ("hdf5:ChunkDimension", [("DimSize", "1")], []);
- Xml.Element
- ("hdf5:RequiredFilter", [],
- [Xml.Element ("hdf5:Deflate", [("Level", "2")], [])])])]);
- Xml.Element
- ("hdf5:FillValueInfo",
- [("FillTime", "FillIfSet"); ("AllocationTime", "Incremental")],
- [Xml.Element
- ("hdf5:FillValue", [], [Xml.Element ("hdf5:NoFill", [], [])])]);
- Xml.Element
- ("hdf5:Dataspace", [],
- [Xml.Element
- ("hdf5:SimpleDataspace", [("Ndims", "1")],
- [Xml.Element
- ("hdf5:Dimension",
- [("DimSize", "6598"); ("MaxDimSize", "UNLIMITED")],
- [])])]);
- Xml.Element
- ("hdf5:DataType", [],
- [Xml.Element
- ("hdf5:AtomicType", [],
- [Xml.Element
- ("hdf5:FloatType",
- [("ByteOrder", "LE"); ("Size", "4");
- ("SignBitLocation", "31"); ("ExponentBits", "8");
- ("ExponentLocation", "23"); ("MantissaBits", "23");
- ("MantissaLocation", "0")],
- [])])]);
- Xml.Element
- ("hdf5:Attribute", [("Name", "Description")],
- [Xml.Element
- ("hdf5:Dataspace", [],
- [Xml.Element
- ("hdf5:SimpleDataspace", [("Ndims", "1")],
- [Xml.Element
- ("hdf5:Dimension",
- [("DimSize", "1"); ("MaxDimSize", "1")], [])])]);
- Xml.Element
- ("hdf5:DataType", [],
- [Xml.Element
- ("hdf5:AtomicType", [],
- [Xml.Element
- ("hdf5:StringType",
- [("Cset", "H5T_CSET_ASCII");
- ("StrSize", "H5T_VARIABLE");
- ("StrPad", "H5T_STR_NULLTERM")],
- [])])]);
- Xml.Element
- ("hdf5:Data", [], [Xml.Element ("hdf5:NoData", [], [])])]);
- Xml.Element
- ("hdf5:Attribute", [("Name", "Shape")],
- [Xml.Element
- ("hdf5:Dataspace", [],
- [Xml.Element
- ("hdf5:SimpleDataspace", [("Ndims", "1")],
- [Xml.Element
- ("hdf5:Dimension",
- [("DimSize", "1"); ("MaxDimSize", "1")], [])])]);
- Xml.Element
- ("hdf5:DataType", [],
- [Xml.Element
- ("hdf5:AtomicType", [],
- [Xml.Element
- ("hdf5:StringType",
- [("Cset", "H5T_CSET_ASCII");
- ("StrSize", "H5T_VARIABLE"); ("StrPad", ...); ...],
- ...);
- ...]);
- ...]);
- ...]);
- ...]);
- ...]);
- ...]);
- ...])
- #
- ------------------
- Ezxmlm:
- # #require "ezxmlm";;
- /home/obd/.opam/4.01.0/lib/xmlm: added to search path
- /home/obd/.opam/4.01.0/lib/xmlm/xmlm.cma: loaded
- /home/obd/.opam/4.01.0/lib/ezxmlm: added to search path
- /home/obd/.opam/4.01.0/lib/ezxmlm/ezxmlm.cma: loaded
- # let ic = open_in "/tmp/foo.xml";;
- val ic : in_channel = <abstr>
- # let dtd, nodes = Ezxmlm.from_channel ic;;
- val dtd : Xmlm.dtd = None
- val nodes : Ezxmlm.nodes =
- [`El
- ((("http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd", "HDF5-File"),
- [(("http://www.w3.org/2000/xmlns/", "hdf5"),
- "http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd");
- (("http://www.w3.org/2000/xmlns/", "xsi"),
- "http://www.w3.org/2001/XMLSchema-instance");
- (("http://www.w3.org/2001/XMLSchema-instance", "schemaLocation"),
- "http://hdfgroup.org/HDF5/XML/schema/HDF5-File http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd")]),
- [`Data "\n";
- `El
- ((("http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd", "RootGroup"),
- [(("", "OBJ-XID"), "xid_96"); (("", "H5Path"), "/")]),
- [`Data "\n ";
- `El
- ((("http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd", "Group"),
- [(("", "Name"), "AerosolResults");
- (("", "OBJ-XID"), "xid_45088");
- (("", "H5Path"), "/AerosolResults");
- (("", "Parents"), "xid_96"); (("", "H5ParentPaths"), "/")]),
- [`Data "\n ";
- `El
- ((("http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd",
- "Dataset"),
- [(("", "Name"), "aerosol_1_aod");
- (("", "OBJ-XID"), "xid_58080");
- (("", "H5Path"), "/AerosolResults/aerosol_1_aod");
- (("", "Parents"), "xid_45088");
- (("", "H5ParentPaths"), "/AerosolResults")]),
- [`Data "\n ";
- `El
- ((("http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd",
- "StorageLayout"),
- []),
- [`Data "\n ";
- `El
- ((("http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd",
- "ChunkedLayout"),
- [(("", "Ndims"), "1")]),
- [`Data "\n ";
- `El
- ((("http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd",
- "ChunkDimension"),
- [(("", "DimSize"), "1")]),
- []);
- `Data "\n ";
- `El
- ((("http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd",
- "RequiredFilter"),
- []),
- [`Data "\n ";
- `El
- ((("http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd",
- "Deflate"),
- [(("", "Level"), "2")]),
- []);
- `Data "\n "]);
- `Data "\n "]);
- `Data "\n "]);
- `Data "\n ";
- `El
- ((("http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd",
- "FillValueInfo"),
- [(("", "FillTime"), "FillIfSet");
- (("", "AllocationTime"), "Incremental")]),
- [`Data "\n ";
- `El
- ((("http://hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd",
- ...),
- ...),
- ...);
- ...]);
- ...]);
- ...]);
- ...]);
- ...]);
- ...]
- #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement