Update copyright.
[shibboleth/cpp-xmltooling.git] / xmltooling / util / XMLHelper.h
index 92d2f2f..f7c9034 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2006 Internet2
+ *  Copyright 2001-2007 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -40,6 +40,11 @@ namespace xmltooling {
         MAKE_NONCOPYABLE(XercesJanitor);
         T* m_held;
     public:
+        /**
+         * Constructor
+         * 
+         * @param resource  object to release when leaving scope
+         */
         XercesJanitor(T* resource) : m_held(resource) {}
         
         ~XercesJanitor() {
@@ -90,6 +95,17 @@ namespace xmltooling {
         static DOMAttr* getIdAttribute(const DOMElement* domElement);
 
         /**
+         * Attempts to locate an XMLObject from this point downward in the tree whose
+         * XML ID matches the supplied value.
+         * 
+         * @param tree  root of tree to search
+         * @param id    ID value to locate
+         * @return XMLObject in the tree with a matching ID value, or NULL
+         */
+        static const XMLObject* getXMLObjectById(const XMLObject& tree, const XMLCh* id);
+        
+
+        /**
          * Gets the QName for the given DOM node.
          * 
          * @param domNode the DOM node
@@ -228,8 +244,9 @@ namespace xmltooling {
          * 
          * @param n     node to serialize
          * @param out   stream to serialize element into
+         * @return reference to output stream
          */
-        static void serialize(const DOMNode* n, std::ostream& out);
+        static std::ostream& serialize(const DOMNode* n, std::ostream& out);
     };
 
     /**