Commit Graph

19 Commits

Author SHA1 Message Date
Antoine Abt
ba2d39e683 Export useful xml functions 2014-10-27 15:45:06 +01:00
Florent gravin
b8e5ffaf31 Use current scope on remote methods call if arg opt_this is undefined 2014-10-03 09:42:09 +02:00
Frederic Junod
d7d2b3353d Add ol.xml.makeObjectPropertyPusher 2014-03-10 17:06:48 +01:00
Bart van den Eijnden
6256bf1989 Add feature id (fid) parsing 2014-02-25 16:28:10 +01:00
ahocevar
3a560c9843 Put jsdoc comment into effect 2014-02-24 14:14:13 +01:00
ahocevar
c1a966bb6f namespaceURI can be null, but not undefined 2014-02-24 13:55:20 +01:00
ahocevar
7b56abdac7 Get rid of compiler warnings 2014-02-23 01:50:59 +01:00
ahocevar
696425af36 Documentation and cleanup 2014-02-21 22:49:33 +01:00
ahocevar
13b4f07cd9 New makeChildrenAppender function and Node factory refactoring
The makeChildAppender function is used for adding a node of a
type with maxOccurs=1. For adding nodes of a type with
maxOccurs>1, the new makeChildrenAppender function was added.

With this new function, it turned out that more convenience for
creating node factories is required. The makeChildNodeFactory
function was renamed to makeSimpleNodeFactory, and it now can
create node factories where not only the namespace, but also the
node name can be fixed.
2014-02-21 16:55:05 +01:00
ahocevar
45860f4552 Framework for serializing structures to XML
This adds several helper functions for serializing to XML:

* ol.xml.serialize: Counterpart to ol.xml.parse. By splitting
  the serialization process up into a node factory and a node
  writer, note writers can easily be used for different
  namespaces.

* ol.xml.pushSerializeAndPop: Counterpart to
  ol.xml.pushParseAndPop.

* ol.xml.makeStructureNS: Works like ol.xml.createParsersNS,
  but works for arbitrary structures.

* ol.xml.makeChildAppender: If the top item of the stack has
  the new ol.xml.NodeStackItem type, this helper function
  can be used to create a serializer that appends the current
  node to its designated parent.

* ol.xml.makeChildNodeFactory: Creates a node factory which
  produces child nodes from an array of node names which are
  passed to ol.xml.serialize.

* ol.xml.makeSequence: A convenience function for creating
  xsd:sequence structures. Takes an object literal and an
  ordered list of the keys, and returns an array that can be
  passed as values to ol.xml.serialize.

* ol.xml.makeSimpleTypeWriter: Using e.g. the new write*TextNode
  functions from ol.format.XSD, this function creates a node
  writer that writes simple type nodes for values like strings
  or numbers.

The following commits will be using this new framework for
implementing ol.format.GPX.writeFeatures, and prose
documentation with instructions based on what was said above
will be added.
2014-02-21 07:18:36 +01:00
Tom Payne
60fe8efca1 Add ol.xml.getLocalName 2014-02-04 22:20:43 +01:00
Tom Payne
d2b7ab697f Add ol.xml.isNode 2014-02-04 22:19:54 +01:00
Tom Payne
a5bb4632e5 Add ol.xml.isDocument 2014-02-04 22:19:51 +01:00
Tom Payne
591a6cd9d2 Add ol.xml.load 2014-02-04 17:36:56 +01:00
Tom Payne
432d10a457 Rename ol.xml.pushAndParse to ol.xml.pushParseAndPop 2014-01-20 16:47:56 +01:00
Tom Payne
71a6897223 Use opt_this instead of opt_obj in ol.xml 2014-01-15 15:09:42 +01:00
Tom Payne
7808ed9ce9 Use firstElementChild in ol.xml.parse 2014-01-06 13:27:13 +01:00
Tom Payne
bd247fa5d7 Add optional parsersNS object to extend 2013-12-20 15:18:52 +01:00
Tom Payne
578699970e Add ol.xml 2013-12-19 17:00:36 +01:00