diff --git a/pacotes/cswclient/csw-proxy.php b/pacotes/cswclient/csw-proxy.php new file mode 100644 index 0000000..19c442e --- /dev/null +++ b/pacotes/cswclient/csw-proxy.php @@ -0,0 +1,115 @@ +load('./lib/xml/csw-hosts.xml'); + +$hosts = $doc->getElementsByTagName("option"); +foreach ($hosts as $host) { + //$csw_host_id = trim($host->nodeValue); + $csw_host = trim($host->getAttribute("value")); + //echo $csw_host."\n"; + array_push($allowed_hosts, $csw_host); +} + + +// Get the REST call path from the AJAX application +// Is it a POST or a GET? +$url = ($_POST['csw_host']) ? $_POST['csw_host'] : $_GET['csw_host']; + +// Check if $url is a known host +if (!in_array($url, $allowed_hosts)) { + echo "not allowed"; + if ($logging) { + fwrite($fh, $timestamp.": refused request...\n"); + fwrite($fh, $timestamp.": HOST NOT ALLOWED> ".$url."\n"); + } +} else { + +if ($logging) { + fwrite($fh, $timestamp.": incoming request...\n"); + fwrite($fh, $timestamp.": HOST> ".$url."\n"); +} + +// Open the Curl session +$session = curl_init($url); + +// If it's a POST, put the POST data in the body +if ($_POST['csw_request']) { + + //if (substr($_POST['csw_request'],0,5) == " ".$xmlpost."\n"); + + } else { + $postvars = ''; + while ($element = current($_POST)) { + if (key($_POST) != "csw_request") + $postvars .= key($_POST).'='.$element.'&'; + else + $postvars .= $element.'&'; + next($_POST); + } + curl_setopt ($session, CURLOPT_POST, true); + curl_setopt ($session, CURLOPT_POSTFIELDS, $_POST['csw_request']); + curl_setopt ($session, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded")); + if ($logging) + fwrite($fh, $timestamp.": POST> ".$_POST['csw_request']."\n"); + } + +} else if ($_GET['csw_request']) { + curl_setopt ($session, CURLOPT_POST, true); + curl_setopt ($session, CURLOPT_POSTFIELDS, $_GET['csw_request']); + curl_setopt ($session, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded")); + if ($logging) + fwrite($fh, $timestamp.": GET> ".$_GET['csw_request']."\n"); +} + + + +// Don't return HTTP headers. Do return the contents of the call +curl_setopt($session, CURLOPT_HEADER, false); +curl_setopt($session, CURLOPT_RETURNTRANSFER, true); + + +// Make the call +$xml = curl_exec($session); + +// The web service returns XML. Set the Content-Type appropriately +header("Content-Type: text/xml"); + +if ($logging) { + fwrite($fh, $timestamp.": RESPONSE> ".$xml."\n"); + fclose($fh); +} + +echo $xml; +curl_close($session); +} +?> diff --git a/pacotes/cswclient/csw.html b/pacotes/cswclient/csw.html new file mode 100644 index 0000000..55bd358 --- /dev/null +++ b/pacotes/cswclient/csw.html @@ -0,0 +1,29 @@ + + + +Simple CSW CLient + + + + + + + + + + + +
+ +
+ + + diff --git a/pacotes/cswclient/excat-manual-eng.pdf b/pacotes/cswclient/excat-manual-eng.pdf new file mode 100644 index 0000000..9b6f1a6 Binary files /dev/null and b/pacotes/cswclient/excat-manual-eng.pdf differ diff --git a/pacotes/cswclient/lib/css/cswclient.css b/pacotes/cswclient/lib/css/cswclient.css new file mode 100644 index 0000000..b4754ce --- /dev/null +++ b/pacotes/cswclient/lib/css/cswclient.css @@ -0,0 +1,210 @@ +/* +* File : cswclient.css +* Author : Rob van Swol +* Organisation: National Aerospace Laboratory NLR +* Country : The Netherlands +* email : vanswol@nlr.nl +* Description: CSS Stylesheet for Simple AJAX based CSW client +* Tested on : FireFox 3, Safari, IE 7 +* Last Change : 2008-10-22 +*/ + +/* ********* csw-wrapper ************* */ +.csw-wrapper { + margin: 0; + padding: 0; + font-size: 11px; + font-family: Verdana, Arial, Tahoma, Helvetica, sans-serif; + color: black; + /*min-width: 768px;*/ +} + +.csw-wrapper a, .csw-wrapper a:link, .csw-wrapper a:visited, .csw-wrapper a:active { + text-decoration: none; + padding: 0px; + color: #0063D3; + /*border-bottom: 1px solid #E5ECF3;*/ +} + +.csw-wrapper a:hover { + background-color: #E5ECF3; +} + +#csw-wrapper { + width: 100%; + margin: 0px auto; + clear: both; +} + +#csw-wrapper.home { + text-align: center; +} + +#csw-wrapper.home h3 { + color: #999; +} + +/* ********* clearfix ************* */ +/* + Float fixer: block elements will not encompasss its child nodes + if its children are floated. Apply this class to the block element. + Not a problem in IE. +*/ + +.clearfix:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; + } + +* html>body .clearfix { + display: inline-block; + width: 100%; + } + +* html .clearfix { + /* Hides from IE-mac \*/ + height: 1%; + /* End hide from IE-mac */ + } + + + +/* ********* main csw content************* */ + +#cswclient { + clear: both; + margin-top: 1em; +} + + +.csw-main { + border: 1px solid #2e4a6b; + clear: both; + /*background: #E6ECF6;*/ + background: #eef4f9; + padding-top: 2em; +} + +.csw-main2 { + border: 0px solid #2e4a6b; + clear: both; + /*background: #E6ECF6;*/ + padding-top: 2em; +} + +.csw-content { + border: 1px solid #eee; + padding-left: 2em; + padding-right: 2em; + padding-bottom: 2em; + background: #eee url("images/diagonal.gif"); + height: 1%; +} + +.csw-content2 { + padding-left: 2em; + padding-right: 2em; + padding-bottom: 2em; + background: #eee url("images/diagonal.gif"); + height: auto; +} + +.meta + { vertical-align: top; + } + +.meta-param + { vertical-align: top; + color: #004393 + } + +.meta-value + { vertical-align: top; + } + +h3 { + font-size: 1.1em; + color: #21507B; + margin-top: 0.6em; +} + +dl{ margin: 0px; padding: 0px;} + +dd{ margin: 0px; padding-left: 2em;} + +li { margin-bottom: 0.3em; } + + + +/* ********* captioneddiv************* */ + +.captioneddiv + { margin: 2em 0em 0em 0em; + padding: 1em; + height:100px; + border: solid #2e4a6b 1px; + background: #ffffff; + } + +html>body .captioneddiv + { margin: 2em 0em 0em 0em; + padding: 1em; + height:auto; + border: solid #2e4a6b 1px; + background: #ffffff; + } + +.captioneddiv h3 + { position: relative; + margin: 0.5em; + top: -2.0em; + left: -1.0em; + padding: 0em 0.5em; + display: inline; + font-size: 0.9em; + /*background: #cae1ff;*/ + background: #ffffff; + } + +#popup + { visibility:hidden; + z-index:100; + width: 600px; + height: 500px; + left: 200px; + position: absolute; + background: #eee url("images/diagonal.gif"); + border: 1px solid #2e4a6b; + } + +#popup2 + { height:500px; + overflow:auto; + position: relative; + } + +.close + { position: relative; + top: 0px; + left: 0px; + padding: 3px; + color: #ffffff; + background: #2e4a6b; + z-index:101; + } + +.close a, .close a:link, .close a:visited, .close a:active .close a:hover { + text-decoration: none; + padding: 0px; + color: #ffffff; +} + +.close a:hover { + background-color: #E5ECF3; + color: #2e4a6b; + border: solid #2e4a6b 1px +} + diff --git a/pacotes/cswclient/lib/css/images/diagonal.gif b/pacotes/cswclient/lib/css/images/diagonal.gif new file mode 100644 index 0000000..d230973 Binary files /dev/null and b/pacotes/cswclient/lib/css/images/diagonal.gif differ diff --git a/pacotes/cswclient/lib/proxy.log b/pacotes/cswclient/lib/proxy.log new file mode 100644 index 0000000..254afb4 --- /dev/null +++ b/pacotes/cswclient/lib/proxy.log @@ -0,0 +1,2 @@ +[2008-10-29 14:38:57]: incoming request... +[2008-10-29 14:38:57]: HOST> http://geonovum.nitg.tno.nl/geonetwork/srv/en/csw diff --git a/pacotes/cswclient/lib/scripts/cswclient.js b/pacotes/cswclient/lib/scripts/cswclient.js new file mode 100644 index 0000000..34fd030 --- /dev/null +++ b/pacotes/cswclient/lib/scripts/cswclient.js @@ -0,0 +1,345 @@ +/* +* File : CSWClient.js +* Author : Rob van Swol +* Organisation: National Aerospace Laboratory NLR +* Country : The Netherlands +* email : vanswol@nlr.nl +* Description: Simple AJAX based CSW client +* Depends csw-proxy.php +* Tested on : FireFox 3, Safari, IE 7 +* Last Change : 2008-10-22 +*/ + +CSWClient = function(cswhost, host){ + this.cswhost = null; + this.use_proxy = true; + if (typeof cswhost != "undefined") { + this.cswhost = cswhost;} + + this.proxy = "csw-proxy.php"; + if (typeof host != "undefined") { + this.proxy = host + "csw-proxy.php";} + + this.getrecords_xsl = this.loadDocument("lib/xsl/getrecords.xsl"); + this.getrecordbyid_xsl = this.loadDocument("lib/xsl/getrecordbyid.xsl"); + this.defaults_xml = this.loadDocument("lib/xml/defaults.xml"); + this.defaultschema = this.defaults_xml.selectSingleNode("/defaults/outputschema/text()").nodeValue; +} + +CSWClient.prototype.setCSWHost = function(host) +{ + this.cswhost = host; +} + +CSWClient.prototype.useProxy = function(tf) +{ + this.use_proxy = tf; +} + +CSWClient.prototype.writeClient = function(divId) +{ + var client_xml = this.loadDocument("lib/xml/cswclient.xml"); + /* if no default cswhost has been defined we provide the user with optional csw hosts */ + if (this.cswhost == null) { + var cswhosts_xml = this.loadDocument("lib/xml/csw-hosts.xml"); + var span = client_xml.selectSingleNode("//span[@id='csw-hosts']"); + importNode = client_xml.importNode(cswhosts_xml.documentElement, true); + span.appendChild(importNode); + } + var serializer = new XMLSerializer(); + var output = serializer.serializeToString(client_xml); + //alert (output); + var div = document.getElementById(divId); + div.innerHTML = output; +} + +CSWClient.prototype.handleCSWResponse = function(request, xml) +{ + + var stylesheet = "lib/xsl/prettyxml.xsl"; + if (request == "getrecords" & + document.theForm.displaymode.value != "xml") { + stylesheet = "lib/xsl/csw-results.xsl"; + } else if (request == "getrecordbyid" & + document.theForm.displaymode.value != "xml") { + stylesheet = "lib/xsl/csw-metadata.xsl"; + } + + xslt = this.loadDocument(stylesheet); + var processor = new XSLTProcessor(); + processor.importStylesheet(xslt); + + var XmlDom = processor.transformToDocument(xml) + var serializer = new XMLSerializer(); + var output = serializer.serializeToString(XmlDom.documentElement); + + var outputDiv = document.getElementById("csw-output"); + if (request == "getrecordbyid"){ + outputDiv = document.getElementById("metadata"); + //this.positionDiv(document.getElementById('popup'), document.getElementById('results')) + //this.positionPopUp(document.getElementById('popup'), document.getElementById('results')) + this.positionPopUp(document.getElementById('popup'), document.getElementById('cswclient')) + this.showDiv(document.getElementById('popup')); + } + outputDiv.innerHTML = output; +} + + +CSWClient.prototype.getRecords = function(start) +{ + + if (typeof start == "undefined") { + start = 1;} + + if (typeof document.theForm.cswhosts != "undefined") { + this.setCSWHost(document.theForm.cswhosts.value);} + + var queryable = document.theForm.queryable.value; + + /*because geonetwork doen not follow the specs*/ + if(this.cswhost.indexOf('geonetwork') !=-1 & queryable == "anytext") + queryable = "any"; + + var operator = document.theForm.operator.value; + var query = trim(document.theForm.query.value); + if (operator == "contains" & query != "") {query = "%" + query + "%";} + + var schema = "http://www.opengis.net/cat/csw/2.0.2"; // force outputSchema always to csw:Record for GetRecords requests + this.setXpathValue(this.defaults_xml, "/defaults/outputschema", schema + ''); + this.setXpathValue(this.defaults_xml, "/defaults/propertyname", queryable + ''); + this.setXpathValue(this.defaults_xml, "/defaults/literal", query + ''); + //this.setXpathValue(defaults_xml, "/this.defaults/literal", query + ''); + this.setXpathValue(this.defaults_xml, "/defaults/startposition", start + ''); + var sortby = document.theForm.sortby.value; + this.setXpathValue(this.defaults_xml, "/defaults/sortby", sortby + ''); + + var processor = new XSLTProcessor(); + processor.importStylesheet(this.getrecords_xsl); + + var request_xml = processor.transformToDocument(this.defaults_xml); + var request = new XMLSerializer().serializeToString(request_xml); + + csw_response = this.sendCSWRequest(request); + var results = ""; + + results_xml = (new DOMParser()).parseFromString(results, "text/xml"); + importNode = results_xml.importNode(csw_response.documentElement, true); + results_xml.documentElement.appendChild(importNode); + //alert(new XMLSerializer().serializeToString(results_xml)); + + //return handleCSWResponse("getrecords", csw_response); + return this.handleCSWResponse("getrecords", results_xml); +} + + +CSWClient.prototype.getRecordById = function(id) +{ + + var schema = this.defaultschema; + if (document.theForm.schema != null) { + schema = document.theForm.schema.value; + } + + this.setXpathValue(this.defaults_xml, "/defaults/outputschema", schema + ''); + this.setXpathValue(this.defaults_xml, "/defaults/id", id + ''); + + var processor = new XSLTProcessor(); + processor.importStylesheet(this.getrecordbyid_xsl); + + var request_xml = processor.transformToDocument(this.defaults_xml); + var request = new XMLSerializer().serializeToString(request_xml); + + csw_response = this.sendCSWRequest(request); + //alert(new XMLSerializer().serializeToString(csw_response)); + return this.handleCSWResponse("getrecordbyid", csw_response); +} + + +CSWClient.prototype.sendCSWRequest = function(request) +{ + + var xml = Sarissa.getDomDocument(); + xml.async = false; + var xmlhttp = new XMLHttpRequest(); + + var params; + if (this.use_proxy) { + params = "csw_host=" + this.cswhost + "&csw_request=" + encodeURIComponent(request); + xmlhttp.open("POST", this.proxy, false); + xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); + } else { + params = request; + xmlhttp.open("POST", this.cswhost, false); + xmlhttp.setRequestHeader("Content-type", "application/xml"); + } + + //xmlhttp.open("POST", this.proxy, false); + //xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); + //xmlhttp.open("POST", this.cswhost, false); + //xmlhttp.setRequestHeader("Content-type", "application/xml"); + xmlhttp.setRequestHeader("Content-length", params.length); + xmlhttp.setRequestHeader("Connection", "close"); + xmlhttp.send(params); // POST + //xmlhttp.send(''); //GET + + xml = xmlhttp.responseXML; + return xml; +} + + +CSWClient.prototype.loadDocument = function(uri) +{ + + var xml = Sarissa.getDomDocument(); + var xmlhttp = new XMLHttpRequest(); + xml.async = false; + xmlhttp.open("GET", uri, false); + xmlhttp.send(''); + xml = xmlhttp.responseXML; + return xml; +} + + +CSWClient.prototype.setXpathValue = function(_a,_b,_c) +{ + + var _e=_a.selectSingleNode(_b); + if(_e){ + if(_e.firstChild){ + _e.firstChild.nodeValue=_c; + }else{ + dom=Sarissa.getDomDocument(); + v=dom.createTextNode(_c); + _e.appendChild(v); + } + return true; + }else{ + return false; + } +}; + + +CSWClient.prototype.clearPage = function() +{ + document.theForm.query.value = ""; + var outputDiv = document.getElementById("csw-output"); + outputDiv.innerHTML = ""; + this.hideDiv(document.getElementById('popup')) +} + +CSWClient.prototype.overlayDiv = function(div) +{ + while (div.tagName !="DIV") { + div = div.parentNode + } + + _width = div.offsetWidth + _height = div.offsetHeight + _top = this.findPosY(div); + _left = this.findPosX(div); + + //overlay = document.createElement("div") + //overlay.setAttribute("id", "overlay") + var overlay = document.getElementById('overlay'); + overlay.style.width = _width + "px" + overlay.style.height = _height + "px" + overlay.style.position = "absolute" + overlay.style.background = "#555555" + overlay.style.top = _top + "px" + overlay.style.left = _left + "px" + + overlay.style.filter = "alpha(opacity=70)" + overlay.style.opacity = "0.7" + overlay.style.mozOpacity = "0.7" + overlay.style.visibility="visible"; + + document.getElementsByTagName("body")[0].appendChild(overlay) +} + +CSWClient.prototype.removeDiv = function(div) +{ + document.getElementsByTagName("body")[0].removeChild(div) +} + +CSWClient.prototype.hideDiv = function(div) +{ + document.getElementById('overlay').style.visibility="hidden"; + div.style.visibility="hidden"; +} + +CSWClient.prototype.showDiv = function(div) +{ + //this.overlayDiv(document.getElementById('results-container')); + this.overlayDiv(document.getElementById('cswclient')); + div.style.visibility="visible"; +} + +CSWClient.prototype.positionDiv = function(div1, div2) +{ + var width = div2.offsetWidth-100 + var height = div2.offsetHeight-100 + var top = this.findPosY(div2)+50; + var left = this.findPosX(div2)+50; + div1.style.width = width + "px" + div1.style.position = "absolute" + div1.style.background = "#ffffff" + div1.style.top = top + "px" + div1.style.left = left + "px" +} + +CSWClient.prototype.positionPopUp = function(div1, div2) +{ + var top = this.findPosY(div2)+50+getScrollY(); + div1.style.top = top + "px" +} + +CSWClient.prototype.findPosX = function(obj) +{ + var curleft = 0; + if(obj.offsetParent) + while(1) { + curleft += obj.offsetLeft; + if(!obj.offsetParent) + break; + obj = obj.offsetParent; + } + else if(obj.x) + curleft += obj.x; + return curleft; +} + +CSWClient.prototype.findPosY = function(obj) +{ + var curtop = 0; + if(obj.offsetParent) + while(1) { + curtop += obj.offsetTop; + if(!obj.offsetParent) + break; + obj = obj.offsetParent; + } + else if(obj.y) + curtop += obj.y; + return curtop; +} + +function getScrollY() +{ + var scrollY = 0; + if (typeof window.pageYOffset == "number") scrollY = window.pageYOffset; + else if (document.documentElement && document.documentElement.scrollTop) + scrollY = document.documentElement.scrollTop; + else if (document.body && document.body.scrollTop) + scrollY = document.body.scrollTop; + else if (window.scrollY) scrollY = window.scrollY; + return scrollY; +} + +function trim(value) { + value = value.replace(/^\s+/,''); + value = value.replace(/\s+$/,''); + return value; +} diff --git a/pacotes/cswclient/lib/scripts/sarissa.js b/pacotes/cswclient/lib/scripts/sarissa.js new file mode 100644 index 0000000..b17fd8f --- /dev/null +++ b/pacotes/cswclient/lib/scripts/sarissa.js @@ -0,0 +1,1025 @@ +/* + * ==================================================================== + * About Sarissa: http://dev.abiss.gr/sarissa + * ==================================================================== + * Sarissa is an ECMAScript library acting as a cross-browser wrapper for native XML APIs. + * The library supports Gecko based browsers like Mozilla and Firefox, + * Internet Explorer (5.5+ with MSXML3.0+), Konqueror, Safari and Opera + * @version 0.9.9.4 + * @author: Copyright 2004-2008 Emmanouil Batsis, mailto: mbatsis at users full stop sourceforge full stop net + * ==================================================================== + * Licence + * ==================================================================== + * Sarissa is free software distributed under the GNU GPL version 2 (see gpl.txt) or higher, + * GNU LGPL version 2.1 (see lgpl.txt) or higher and Apache Software License 2.0 or higher + * (see asl.txt). This means you can choose one of the three and use that if you like. If + * you make modifications under the ASL, i would appreciate it if you submitted those. + * In case your copy of Sarissa does not include the license texts, you may find + * them online in various formats at http://www.gnu.org and + * http://www.apache.org. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY + * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +/** + *

Sarissa is a utility class. Provides "static" methods for DOMDocument, + * DOM Node serialization to XML strings and other utility goodies.

+ * @constructor + * @static + */ +function Sarissa(){} +Sarissa.VERSION = "0.9.9.4"; +Sarissa.PARSED_OK = "Document contains no parsing errors"; +Sarissa.PARSED_EMPTY = "Document is empty"; +Sarissa.PARSED_UNKNOWN_ERROR = "Not well-formed or other error"; +Sarissa.IS_ENABLED_TRANSFORM_NODE = false; +Sarissa.REMOTE_CALL_FLAG = "gr.abiss.sarissa.REMOTE_CALL_FLAG"; +/** @private */ +Sarissa._lastUniqueSuffix = 0; +/** @private */ +Sarissa._getUniqueSuffix = function(){ + return Sarissa._lastUniqueSuffix++; +}; +/** @private */ +Sarissa._SARISSA_IEPREFIX4XSLPARAM = ""; +/** @private */ +Sarissa._SARISSA_HAS_DOM_IMPLEMENTATION = document.implementation && true; +/** @private */ +Sarissa._SARISSA_HAS_DOM_CREATE_DOCUMENT = Sarissa._SARISSA_HAS_DOM_IMPLEMENTATION && document.implementation.createDocument; +/** @private */ +Sarissa._SARISSA_HAS_DOM_FEATURE = Sarissa._SARISSA_HAS_DOM_IMPLEMENTATION && document.implementation.hasFeature; +/** @private */ +Sarissa._SARISSA_IS_MOZ = Sarissa._SARISSA_HAS_DOM_CREATE_DOCUMENT && Sarissa._SARISSA_HAS_DOM_FEATURE; +/** @private */ +Sarissa._SARISSA_IS_SAFARI = navigator.userAgent.toLowerCase().indexOf("safari") != -1 || navigator.userAgent.toLowerCase().indexOf("konqueror") != -1; +/** @private */ +Sarissa._SARISSA_IS_SAFARI_OLD = Sarissa._SARISSA_IS_SAFARI && (parseInt((navigator.userAgent.match(/AppleWebKit\/(\d+)/)||{})[1], 10) < 420); +/** @private */ +Sarissa._SARISSA_IS_IE = document.all && window.ActiveXObject && navigator.userAgent.toLowerCase().indexOf("msie") > -1 && navigator.userAgent.toLowerCase().indexOf("opera") == -1; +/** @private */ +Sarissa._SARISSA_IS_OPERA = navigator.userAgent.toLowerCase().indexOf("opera") != -1; +if(!window.Node || !Node.ELEMENT_NODE){ + Node = {ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, TEXT_NODE: 3, CDATA_SECTION_NODE: 4, ENTITY_REFERENCE_NODE: 5, ENTITY_NODE: 6, PROCESSING_INSTRUCTION_NODE: 7, COMMENT_NODE: 8, DOCUMENT_NODE: 9, DOCUMENT_TYPE_NODE: 10, DOCUMENT_FRAGMENT_NODE: 11, NOTATION_NODE: 12}; +} + +//This breaks for(x in o) loops in the old Safari +if(Sarissa._SARISSA_IS_SAFARI_OLD){ + HTMLHtmlElement = document.createElement("html").constructor; + Node = HTMLElement = {}; + HTMLElement.prototype = HTMLHtmlElement.__proto__.__proto__; + HTMLDocument = Document = document.constructor; + var x = new DOMParser(); + XMLDocument = x.constructor; + Element = x.parseFromString("", "text/xml").documentElement.constructor; + x = null; +} +if(typeof XMLDocument == "undefined" && typeof Document !="undefined"){ XMLDocument = Document; } + +// IE initialization +if(Sarissa._SARISSA_IS_IE){ + // for XSLT parameter names, prefix needed by IE + Sarissa._SARISSA_IEPREFIX4XSLPARAM = "xsl:"; + // used to store the most recent ProgID available out of the above + var _SARISSA_DOM_PROGID = ""; + var _SARISSA_XMLHTTP_PROGID = ""; + var _SARISSA_DOM_XMLWRITER = ""; + /** + * Called when the sarissa.js file is parsed, to pick most recent + * ProgIDs for IE, then gets destroyed. + * @memberOf Sarissa + * @private + * @param idList an array of MSXML PROGIDs from which the most recent will be picked for a given object + * @param enabledList an array of arrays where each array has two items; the index of the PROGID for which a certain feature is enabled + */ + Sarissa.pickRecentProgID = function (idList){ + // found progID flag + var bFound = false, e; + var o2Store; + for(var i=0; i < idList.length && !bFound; i++){ + try{ + var oDoc = new ActiveXObject(idList[i]); + o2Store = idList[i]; + bFound = true; + }catch (objException){ + // trap; try next progID + e = objException; + } + } + if (!bFound) { + throw "Could not retrieve a valid progID of Class: " + idList[idList.length-1]+". (original exception: "+e+")"; + } + idList = null; + return o2Store; + }; + // pick best available MSXML progIDs + _SARISSA_DOM_PROGID = null; + _SARISSA_THREADEDDOM_PROGID = null; + _SARISSA_XSLTEMPLATE_PROGID = null; + _SARISSA_XMLHTTP_PROGID = null; + // commenting the condition out; we need to redefine XMLHttpRequest + // anyway as IE7 hardcodes it to MSXML3.0 causing version problems + // between different activex controls + //if(!window.XMLHttpRequest){ + /** + * Emulate XMLHttpRequest + * @constructor + */ + XMLHttpRequest = function() { + if(!_SARISSA_XMLHTTP_PROGID){ + _SARISSA_XMLHTTP_PROGID = Sarissa.pickRecentProgID(["Msxml2.XMLHTTP.6.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"]); + } + return new ActiveXObject(_SARISSA_XMLHTTP_PROGID); + }; + //} + // we dont need this anymore + //============================================ + // Factory methods (IE) + //============================================ + // see non-IE version + Sarissa.getDomDocument = function(sUri, sName){ + if(!_SARISSA_DOM_PROGID){ + _SARISSA_DOM_PROGID = Sarissa.pickRecentProgID(["Msxml2.DOMDocument.6.0", "Msxml2.DOMDocument.3.0", "MSXML2.DOMDocument", "MSXML.DOMDocument", "Microsoft.XMLDOM"]); + } + var oDoc = new ActiveXObject(_SARISSA_DOM_PROGID); + // if a root tag name was provided, we need to load it in the DOM object + if (sName){ + // create an artifical namespace prefix + // or reuse existing prefix if applicable + var prefix = ""; + if(sUri){ + if(sName.indexOf(":") > 1){ + prefix = sName.substring(0, sName.indexOf(":")); + sName = sName.substring(sName.indexOf(":")+1); + }else{ + prefix = "a" + Sarissa._getUniqueSuffix(); + } + } + // use namespaces if a namespace URI exists + if(sUri){ + oDoc.loadXML('<' + prefix+':'+sName + " xmlns:" + prefix + "=\"" + sUri + "\"" + " />"); + } else { + oDoc.loadXML('<' + sName + " />"); + } + } + return oDoc; + }; + // see non-IE version + Sarissa.getParseErrorText = function (oDoc) { + var parseErrorText = Sarissa.PARSED_OK; + if(oDoc && oDoc.parseError && oDoc.parseError.errorCode && oDoc.parseError.errorCode != 0){ + parseErrorText = "XML Parsing Error: " + oDoc.parseError.reason + + "\nLocation: " + oDoc.parseError.url + + "\nLine Number " + oDoc.parseError.line + ", Column " + + oDoc.parseError.linepos + + ":\n" + oDoc.parseError.srcText + + "\n"; + for(var i = 0; i < oDoc.parseError.linepos;i++){ + parseErrorText += "-"; + } + parseErrorText += "^\n"; + } + else if(oDoc.documentElement === null){ + parseErrorText = Sarissa.PARSED_EMPTY; + } + return parseErrorText; + }; + // see non-IE version + Sarissa.setXpathNamespaces = function(oDoc, sNsSet) { + oDoc.setProperty("SelectionLanguage", "XPath"); + oDoc.setProperty("SelectionNamespaces", sNsSet); + }; + /** + * A class that reuses the same XSLT stylesheet for multiple transforms. + * @constructor + */ + XSLTProcessor = function(){ + if(!_SARISSA_XSLTEMPLATE_PROGID){ + _SARISSA_XSLTEMPLATE_PROGID = Sarissa.pickRecentProgID(["Msxml2.XSLTemplate.6.0", "MSXML2.XSLTemplate.3.0"]); + } + this.template = new ActiveXObject(_SARISSA_XSLTEMPLATE_PROGID); + this.processor = null; + }; + /** + * Imports the given XSLT DOM and compiles it to a reusable transform + * Note: If the stylesheet was loaded from a URL and contains xsl:import or xsl:include elements,it will be reloaded to resolve those + * @param {DOMDocument} xslDoc The XSLT DOMDocument to import + */ + XSLTProcessor.prototype.importStylesheet = function(xslDoc){ + if(!_SARISSA_THREADEDDOM_PROGID){ + _SARISSA_THREADEDDOM_PROGID = Sarissa.pickRecentProgID(["MSXML2.FreeThreadedDOMDocument.6.0", "MSXML2.FreeThreadedDOMDocument.3.0"]); + } + xslDoc.setProperty("SelectionLanguage", "XPath"); + xslDoc.setProperty("SelectionNamespaces", "xmlns:xsl='http://www.w3.org/1999/XSL/Transform'"); + // convert stylesheet to free threaded + var converted = new ActiveXObject(_SARISSA_THREADEDDOM_PROGID); + // make included/imported stylesheets work if exist and xsl was originally loaded from url + try{ + converted.resolveExternals = true; + converted.setProperty("AllowDocumentFunction", true); + } + catch(e){ + // Ignore. "AllowDocumentFunction" is only supported in MSXML 3.0 SP4 and later. + } + if(xslDoc.url && xslDoc.selectSingleNode("//xsl:*[local-name() = 'import' or local-name() = 'include']") != null){ + converted.async = false; + converted.load(xslDoc.url); + } + else { + converted.loadXML(xslDoc.xml); + } + converted.setProperty("SelectionNamespaces", "xmlns:xsl='http://www.w3.org/1999/XSL/Transform'"); + var output = converted.selectSingleNode("//xsl:output"); + //this.outputMethod = output ? output.getAttribute("method") : "html"; + if(output) { + this.outputMethod = output.getAttribute("method"); + } + else { + delete this.outputMethod; + } + this.template.stylesheet = converted; + this.processor = this.template.createProcessor(); + // for getParameter and clearParameters + this.paramsSet = []; + }; + + /** + * Transform the given XML DOM and return the transformation result as a new DOM document + * @param {DOMDocument} sourceDoc The XML DOMDocument to transform + * @return {DOMDocument} The transformation result as a DOM Document + */ + XSLTProcessor.prototype.transformToDocument = function(sourceDoc){ + // fix for bug 1549749 + var outDoc; + if(_SARISSA_THREADEDDOM_PROGID){ + this.processor.input=sourceDoc; + outDoc=new ActiveXObject(_SARISSA_DOM_PROGID); + this.processor.output=outDoc; + this.processor.transform(); + return outDoc; + } + else{ + if(!_SARISSA_DOM_XMLWRITER){ + _SARISSA_DOM_XMLWRITER = Sarissa.pickRecentProgID(["Msxml2.MXXMLWriter.6.0", "Msxml2.MXXMLWriter.3.0", "MSXML2.MXXMLWriter", "MSXML.MXXMLWriter", "Microsoft.XMLDOM"]); + } + this.processor.input = sourceDoc; + outDoc = new ActiveXObject(_SARISSA_DOM_XMLWRITER); + this.processor.output = outDoc; + this.processor.transform(); + var oDoc = new ActiveXObject(_SARISSA_DOM_PROGID); + oDoc.loadXML(outDoc.output+""); + return oDoc; + } + }; + + /** + * Transform the given XML DOM and return the transformation result as a new DOM fragment. + * Note: The xsl:output method must match the nature of the owner document (XML/HTML). + * @param {DOMDocument} sourceDoc The XML DOMDocument to transform + * @param {DOMDocument} ownerDoc The owner of the result fragment + * @return {DOMDocument} The transformation result as a DOM Document + */ + XSLTProcessor.prototype.transformToFragment = function (sourceDoc, ownerDoc) { + this.processor.input = sourceDoc; + this.processor.transform(); + var s = this.processor.output; + var f = ownerDoc.createDocumentFragment(); + var container; + if (this.outputMethod == 'text') { + f.appendChild(ownerDoc.createTextNode(s)); + } else if (ownerDoc.body && ownerDoc.body.innerHTML) { + container = ownerDoc.createElement('div'); + container.innerHTML = s; + while (container.hasChildNodes()) { + f.appendChild(container.firstChild); + } + } + else { + var oDoc = new ActiveXObject(_SARISSA_DOM_PROGID); + if (s.substring(0, 5) == '') + 2); + } + var xml = ''.concat('', s, ''); + oDoc.loadXML(xml); + container = oDoc.documentElement; + while (container.hasChildNodes()) { + f.appendChild(container.firstChild); + } + } + return f; + }; + + /** + * Set global XSLT parameter of the imported stylesheet + * @param {String} nsURI The parameter namespace URI + * @param {String} name The parameter base name + * @param {String} value The new parameter value + */ + XSLTProcessor.prototype.setParameter = function(nsURI, name, value){ + // make value a zero length string if null to allow clearing + value = value ? value : ""; + // nsURI is optional but cannot be null + if(nsURI){ + this.processor.addParameter(name, value, nsURI); + }else{ + this.processor.addParameter(name, value); + } + // update updated params for getParameter + nsURI = "" + (nsURI || ""); + if(!this.paramsSet[nsURI]){ + this.paramsSet[nsURI] = []; + } + this.paramsSet[nsURI][name] = value; + }; + /** + * Gets a parameter if previously set by setParameter. Returns null + * otherwise + * @param {String} name The parameter base name + * @param {String} value The new parameter value + * @return {String} The parameter value if reviously set by setParameter, null otherwise + */ + XSLTProcessor.prototype.getParameter = function(nsURI, name){ + nsURI = "" + (nsURI || ""); + if(this.paramsSet[nsURI] && this.paramsSet[nsURI][name]){ + return this.paramsSet[nsURI][name]; + }else{ + return null; + } + }; + + /** + * Clear parameters (set them to default values as defined in the stylesheet itself) + */ + XSLTProcessor.prototype.clearParameters = function(){ + for(var nsURI in this.paramsSet){ + for(var name in this.paramsSet[nsURI]){ + if(nsURI!=""){ + this.processor.addParameter(name, "", nsURI); + }else{ + this.processor.addParameter(name, ""); + } + } + } + this.paramsSet = []; + }; +}else{ /* end IE initialization, try to deal with real browsers now ;-) */ + if(Sarissa._SARISSA_HAS_DOM_CREATE_DOCUMENT){ + /** + *

Ensures the document was loaded correctly, otherwise sets the + * parseError to -1 to indicate something went wrong. Internal use

+ * @private + */ + Sarissa.__handleLoad__ = function(oDoc){ + Sarissa.__setReadyState__(oDoc, 4); + }; + /** + *

Attached by an event handler to the load event. Internal use.

+ * @private + */ + _sarissa_XMLDocument_onload = function(){ + Sarissa.__handleLoad__(this); + }; + /** + *

Sets the readyState property of the given DOM Document object. + * Internal use.

+ * @memberOf Sarissa + * @private + * @param oDoc the DOM Document object to fire the + * readystatechange event + * @param iReadyState the number to change the readystate property to + */ + Sarissa.__setReadyState__ = function(oDoc, iReadyState){ + oDoc.readyState = iReadyState; + oDoc.readystate = iReadyState; + if (oDoc.onreadystatechange != null && typeof oDoc.onreadystatechange == "function") { + oDoc.onreadystatechange(); + } + }; + + Sarissa.getDomDocument = function(sUri, sName){ + var oDoc = document.implementation.createDocument(sUri?sUri:null, sName?sName:null, null); + if(!oDoc.onreadystatechange){ + + /** + *

Emulate IE's onreadystatechange attribute

+ */ + oDoc.onreadystatechange = null; + } + if(!oDoc.readyState){ + /** + *

Emulates IE's readyState property, which always gives an integer from 0 to 4:

+ * + */ + oDoc.readyState = 0; + } + oDoc.addEventListener("load", _sarissa_XMLDocument_onload, false); + return oDoc; + }; + if(window.XMLDocument){ + // do nothing + }// TODO: check if the new document has content before trying to copynodes, check for error handling in DOM 3 LS + else if(Sarissa._SARISSA_HAS_DOM_FEATURE && window.Document && !Document.prototype.load && document.implementation.hasFeature('LS', '3.0')){ + //Opera 9 may get the XPath branch which gives creates XMLDocument, therefore it doesn't reach here which is good + /** + *

Factory method to obtain a new DOM Document object

+ * @memberOf Sarissa + * @param {String} sUri the namespace of the root node (if any) + * @param {String} sUri the local name of the root node (if any) + * @returns {DOMDOcument} a new DOM Document + */ + Sarissa.getDomDocument = function(sUri, sName){ + var oDoc = document.implementation.createDocument(sUri?sUri:null, sName?sName:null, null); + return oDoc; + }; + } + else { + Sarissa.getDomDocument = function(sUri, sName){ + var oDoc = document.implementation.createDocument(sUri?sUri:null, sName?sName:null, null); + // looks like safari does not create the root element for some unknown reason + if(oDoc && (sUri || sName) && !oDoc.documentElement){ + oDoc.appendChild(oDoc.createElementNS(sUri, sName)); + } + return oDoc; + }; + } + }//if(Sarissa._SARISSA_HAS_DOM_CREATE_DOCUMENT) +} +//========================================== +// Common stuff +//========================================== +if(!window.DOMParser){ + if(Sarissa._SARISSA_IS_SAFARI){ + /** + * DOMParser is a utility class, used to construct DOMDocuments from XML strings + * @constructor + */ + DOMParser = function() { }; + /** + * Construct a new DOM Document from the given XMLstring + * @param {String} sXml the given XML string + * @param {String} contentType the content type of the document the given string represents (one of text/xml, application/xml, application/xhtml+xml). + * @return {DOMDocument} a new DOM Document from the given XML string + */ + DOMParser.prototype.parseFromString = function(sXml, contentType){ + var xmlhttp = new XMLHttpRequest(); + xmlhttp.open("GET", "data:text/xml;charset=utf-8," + encodeURIComponent(sXml), false); + xmlhttp.send(null); + return xmlhttp.responseXML; + }; + }else if(Sarissa.getDomDocument && Sarissa.getDomDocument() && Sarissa.getDomDocument(null, "bar").xml){ + DOMParser = function() { }; + DOMParser.prototype.parseFromString = function(sXml, contentType){ + var doc = Sarissa.getDomDocument(); + doc.loadXML(sXml); + return doc; + }; + } +} + +if((typeof(document.importNode) == "undefined") && Sarissa._SARISSA_IS_IE){ + try{ + /** + * Implementation of importNode for the context window document in IE. + * If oNode is a TextNode, bChildren is ignored. + * @param {DOMNode} oNode the Node to import + * @param {boolean} bChildren whether to include the children of oNode + * @returns the imported node for further use + */ + document.importNode = function(oNode, bChildren){ + var tmp; + if (oNode.nodeName=='#text') { + return document.createTextNode(oNode.data); + } + else { + if(oNode.nodeName == "tbody" || oNode.nodeName == "tr"){ + tmp = document.createElement("table"); + } + else if(oNode.nodeName == "td"){ + tmp = document.createElement("tr"); + } + else if(oNode.nodeName == "option"){ + tmp = document.createElement("select"); + } + else{ + tmp = document.createElement("div"); + } + if(bChildren){ + tmp.innerHTML = oNode.xml ? oNode.xml : oNode.outerHTML; + }else{ + tmp.innerHTML = oNode.xml ? oNode.cloneNode(false).xml : oNode.cloneNode(false).outerHTML; + } + return tmp.getElementsByTagName("*")[0]; + } + }; + }catch(e){ } +} +if(!Sarissa.getParseErrorText){ + /** + *

Returns a human readable description of the parsing error. Usefull + * for debugging. Tip: append the returned error string in a <pre> + * element if you want to render it.

+ *

Many thanks to Christian Stocker for the initial patch.

+ * @memberOf Sarissa + * @param {DOMDocument} oDoc The target DOM document + * @returns {String} The parsing error description of the target Document in + * human readable form (preformated text) + */ + Sarissa.getParseErrorText = function (oDoc){ + var parseErrorText = Sarissa.PARSED_OK; + if((!oDoc) || (!oDoc.documentElement)){ + parseErrorText = Sarissa.PARSED_EMPTY; + } else if(oDoc.documentElement.tagName == "parsererror"){ + parseErrorText = oDoc.documentElement.firstChild.data; + parseErrorText += "\n" + oDoc.documentElement.firstChild.nextSibling.firstChild.data; + } else if(oDoc.getElementsByTagName("parsererror").length > 0){ + var parsererror = oDoc.getElementsByTagName("parsererror")[0]; + parseErrorText = Sarissa.getText(parsererror, true)+"\n"; + } else if(oDoc.parseError && oDoc.parseError.errorCode != 0){ + parseErrorText = Sarissa.PARSED_UNKNOWN_ERROR; + } + return parseErrorText; + }; +} +/** + * Get a string with the concatenated values of all string nodes under the given node + * @param {DOMNode} oNode the given DOM node + * @param {boolean} deep whether to recursively scan the children nodes of the given node for text as well. Default is false + * @memberOf Sarissa + */ +Sarissa.getText = function(oNode, deep){ + var s = ""; + var nodes = oNode.childNodes; + for(var i=0; i < nodes.length; i++){ + var node = nodes[i]; + var nodeType = node.nodeType; + if(nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE){ + s += node.data; + } else if(deep === true && (nodeType == Node.ELEMENT_NODE || nodeType == Node.DOCUMENT_NODE || nodeType == Node.DOCUMENT_FRAGMENT_NODE)){ + s += Sarissa.getText(node, true); + } + } + return s; +}; +if(!window.XMLSerializer && Sarissa.getDomDocument && Sarissa.getDomDocument("","foo", null).xml){ + /** + * Utility class to serialize DOM Node objects to XML strings + * @constructor + */ + XMLSerializer = function(){}; + /** + * Serialize the given DOM Node to an XML string + * @param {DOMNode} oNode the DOM Node to serialize + */ + XMLSerializer.prototype.serializeToString = function(oNode) { + return oNode.xml; + }; +} + +/** + * Strips tags from the given markup string. If the given string is + * undefined, null or empty, it is returned as is. + * @memberOf Sarissa + * @param {String} s the string to strip the tags from + */ +Sarissa.stripTags = function (s) { + return s?s.replace(/<[^>]+>/g,""):s; +}; +/** + *

Deletes all child nodes of the given node

+ * @memberOf Sarissa + * @param {DOMNode} oNode the Node to empty + */ +Sarissa.clearChildNodes = function(oNode) { + // need to check for firstChild due to opera 8 bug with hasChildNodes + while(oNode.firstChild) { + oNode.removeChild(oNode.firstChild); + } +}; +/** + *

Copies the childNodes of nodeFrom to nodeTo

+ *

Note: The second object's original content is deleted before + * the copy operation, unless you supply a true third parameter

+ * @memberOf Sarissa + * @param {DOMNode} nodeFrom the Node to copy the childNodes from + * @param {DOMNode} nodeTo the Node to copy the childNodes to + * @param {boolean} bPreserveExisting whether to preserve the original content of nodeTo, default is false + */ +Sarissa.copyChildNodes = function(nodeFrom, nodeTo, bPreserveExisting) { + if(Sarissa._SARISSA_IS_SAFARI && nodeTo.nodeType == Node.DOCUMENT_NODE){ // SAFARI_OLD ?? + nodeTo = nodeTo.documentElement; //Apparently there's a bug in safari where you can't appendChild to a document node + } + + if((!nodeFrom) || (!nodeTo)){ + throw "Both source and destination nodes must be provided"; + } + if(!bPreserveExisting){ + Sarissa.clearChildNodes(nodeTo); + } + var ownerDoc = nodeTo.nodeType == Node.DOCUMENT_NODE ? nodeTo : nodeTo.ownerDocument; + var nodes = nodeFrom.childNodes; + var i; + if(typeof(ownerDoc.importNode) != "undefined") { + for(i=0;i < nodes.length;i++) { + nodeTo.appendChild(ownerDoc.importNode(nodes[i], true)); + } + } else { + for(i=0;i < nodes.length;i++) { + nodeTo.appendChild(nodes[i].cloneNode(true)); + } + } +}; + +/** + *

Moves the childNodes of nodeFrom to nodeTo

+ *

Note: The second object's original content is deleted before + * the move operation, unless you supply a true third parameter

+ * @memberOf Sarissa + * @param {DOMNode} nodeFrom the Node to copy the childNodes from + * @param {DOMNode} nodeTo the Node to copy the childNodes to + * @param {boolean} bPreserveExisting whether to preserve the original content of nodeTo, default is + */ +Sarissa.moveChildNodes = function(nodeFrom, nodeTo, bPreserveExisting) { + if((!nodeFrom) || (!nodeTo)){ + throw "Both source and destination nodes must be provided"; + } + if(!bPreserveExisting){ + Sarissa.clearChildNodes(nodeTo); + } + var nodes = nodeFrom.childNodes; + // if within the same doc, just move, else copy and delete + if(nodeFrom.ownerDocument == nodeTo.ownerDocument){ + while(nodeFrom.firstChild){ + nodeTo.appendChild(nodeFrom.firstChild); + } + } else { + var ownerDoc = nodeTo.nodeType == Node.DOCUMENT_NODE ? nodeTo : nodeTo.ownerDocument; + var i; + if(typeof(ownerDoc.importNode) != "undefined") { + for(i=0;i < nodes.length;i++) { + nodeTo.appendChild(ownerDoc.importNode(nodes[i], true)); + } + }else{ + for(i=0;i < nodes.length;i++) { + nodeTo.appendChild(nodes[i].cloneNode(true)); + } + } + Sarissa.clearChildNodes(nodeFrom); + } +}; + +/** + *

Serialize any non DOM object to an XML string. All properties are serialized using the property name + * as the XML element name. Array elements are rendered as array-item elements, + * using their index/key as the value of the key attribute.

+ * @memberOf Sarissa + * @param {Object} anyObject the object to serialize + * @param {String} objectName a name for that object, to be used as the root element name + * @return {String} the XML serialization of the given object as a string + */ +Sarissa.xmlize = function(anyObject, objectName, indentSpace){ + indentSpace = indentSpace?indentSpace:''; + var s = indentSpace + '<' + objectName + '>'; + var isLeaf = false; + if(!(anyObject instanceof Object) || anyObject instanceof Number || anyObject instanceof String || anyObject instanceof Boolean || anyObject instanceof Date){ + s += Sarissa.escape(""+anyObject); + isLeaf = true; + }else{ + s += "\n"; + var isArrayItem = anyObject instanceof Array; + for(var name in anyObject){ + s += Sarissa.xmlize(anyObject[name], (isArrayItem?"array-item key=\""+name+"\"":name), indentSpace + " "); + } + s += indentSpace; + } + return (s += (objectName.indexOf(' ')!=-1?"\n":"\n")); +}; + +/** + * Escape the given string chacters that correspond to the five predefined XML entities + * @memberOf Sarissa + * @param {String} sXml the string to escape + */ +Sarissa.escape = function(sXml){ + return sXml.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'"); +}; + +/** + * Unescape the given string. This turns the occurences of the predefined XML + * entities to become the characters they represent correspond to the five predefined XML entities + * @memberOf Sarissa + * @param {String}sXml the string to unescape + */ +Sarissa.unescape = function(sXml){ + return sXml.replace(/'/g,"'").replace(/"/g,"\"").replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&"); +}; + +/** @private */ +Sarissa.updateCursor = function(oTargetElement, sValue) { + if(oTargetElement && oTargetElement.style && oTargetElement.style.cursor != undefined ){ + oTargetElement.style.cursor = sValue; + } +}; + +/** + * Asynchronously update an element with response of a GET request on the given URL. Passing a configured XSLT + * processor will result in transforming and updating oNode before using it to update oTargetElement. + * You can also pass a callback function to be executed when the update is finished. The function will be called as + * functionName(oNode, oTargetElement); + * @memberOf Sarissa + * @param {String} sFromUrl the URL to make the request to + * @param {DOMElement} oTargetElement the element to update + * @param {XSLTProcessor} xsltproc (optional) the transformer to use on the returned + * content before updating the target element with it + * @param {Function} callback (optional) a Function object to execute once the update is finished successfuly, called as callback(sFromUrl, oTargetElement). + * In case an exception is thrown during execution, the callback is called as called as callback(sFromUrl, oTargetElement, oException) + * @param {boolean} skipCache (optional) whether to skip any cache + */ +Sarissa.updateContentFromURI = function(sFromUrl, oTargetElement, xsltproc, callback, skipCache) { + try{ + Sarissa.updateCursor(oTargetElement, "wait"); + var xmlhttp = new XMLHttpRequest(); + xmlhttp.open("GET", sFromUrl, true); + xmlhttp.onreadystatechange = function() { + if (xmlhttp.readyState == 4) { + try{ + var oDomDoc = xmlhttp.responseXML; + if(oDomDoc && Sarissa.getParseErrorText(oDomDoc) == Sarissa.PARSED_OK){ + Sarissa.updateContentFromNode(xmlhttp.responseXML, oTargetElement, xsltproc); + if(callback){ + callback(sFromUrl, oTargetElement); + } + } + else{ + throw Sarissa.getParseErrorText(oDomDoc); + } + } + catch(e){ + if(callback){ + callback(sFromUrl, oTargetElement, e); + } + else{ + throw e; + } + } + } + }; + if (skipCache) { + var oldage = "Sat, 1 Jan 2000 00:00:00 GMT"; + xmlhttp.setRequestHeader("If-Modified-Since", oldage); + } + xmlhttp.send(""); + } + catch(e){ + Sarissa.updateCursor(oTargetElement, "auto"); + if(callback){ + callback(sFromUrl, oTargetElement, e); + } + else{ + throw e; + } + } +}; + +/** + * Update an element's content with the given DOM node. Passing a configured XSLT + * processor will result in transforming and updating oNode before using it to update oTargetElement. + * You can also pass a callback function to be executed when the update is finished. The function will be called as + * functionName(oNode, oTargetElement); + * @memberOf Sarissa + * @param {DOMNode} oNode the URL to make the request to + * @param {DOMElement} oTargetElement the element to update + * @param {XSLTProcessor} xsltproc (optional) the transformer to use on the given + * DOM node before updating the target element with it + */ +Sarissa.updateContentFromNode = function(oNode, oTargetElement, xsltproc) { + try { + Sarissa.updateCursor(oTargetElement, "wait"); + Sarissa.clearChildNodes(oTargetElement); + // check for parsing errors + var ownerDoc = oNode.nodeType == Node.DOCUMENT_NODE?oNode:oNode.ownerDocument; + if(ownerDoc.parseError && ownerDoc.parseError.errorCode != 0) { + var pre = document.createElement("pre"); + pre.appendChild(document.createTextNode(Sarissa.getParseErrorText(ownerDoc))); + oTargetElement.appendChild(pre); + } + else { + // transform if appropriate + if(xsltproc) { + oNode = xsltproc.transformToDocument(oNode); + } + // be smart, maybe the user wants to display the source instead + if(oTargetElement.tagName.toLowerCase() == "textarea" || oTargetElement.tagName.toLowerCase() == "input") { + oTargetElement.value = new XMLSerializer().serializeToString(oNode); + } + else { + // ok that was not smart; it was paranoid. Keep up the good work by trying to use DOM instead of innerHTML + try{ + oTargetElement.appendChild(oTargetElement.ownerDocument.importNode(oNode, true)); + } + catch(e){ + oTargetElement.innerHTML = new XMLSerializer().serializeToString(oNode); + } + } + } + } + catch(e) { + throw e; + } + finally{ + Sarissa.updateCursor(oTargetElement, "auto"); + } +}; + + +/** + * Creates an HTTP URL query string from the given HTML form data + * @memberOf Sarissa + * @param {HTMLFormElement} oForm the form to construct the query string from + */ +Sarissa.formToQueryString = function(oForm){ + var qs = ""; + for(var i = 0;i < oForm.elements.length;i++) { + var oField = oForm.elements[i]; + var sFieldName = oField.getAttribute("name") ? oField.getAttribute("name") : oField.getAttribute("id"); + // ensure we got a proper name/id and that the field is not disabled + if(sFieldName && + ((!oField.disabled) || oField.type == "hidden")) { + switch(oField.type) { + case "hidden": + case "text": + case "textarea": + case "password": + qs += sFieldName + "=" + encodeURIComponent(oField.value) + "&"; + break; + case "select-one": + qs += sFieldName + "=" + encodeURIComponent(oField.options[oField.selectedIndex].value) + "&"; + break; + case "select-multiple": + for (var j = 0; j < oField.length; j++) { + var optElem = oField.options[j]; + if (optElem.selected === true) { + qs += sFieldName + "[]" + "=" + encodeURIComponent(optElem.value) + "&"; + } + } + break; + case "checkbox": + case "radio": + if(oField.checked) { + qs += sFieldName + "=" + encodeURIComponent(oField.value) + "&"; + } + break; + } + } + } + // return after removing last '&' + return qs.substr(0, qs.length - 1); +}; + + +/** + * Asynchronously update an element with response of an XMLHttpRequest-based emulation of a form submission.

The form action and + * method attributess will be followed. Passing a configured XSLT processor will result in + * transforming and updating the server response before using it to update the target element. + * You can also pass a callback function to be executed when the update is finished. The function will be called as + * functionName(oNode, oTargetElement);

+ *

Here is an example of using this in a form element:

+ *
+ * <div id="targetId"> this content will be updated</div>
+ * <form action="/my/form/handler" method="post" 
+ *     onbeforesubmit="return Sarissa.updateContentFromForm(this, document.getElementById('targetId'));">
+ * 

If JavaScript is supported, the form will not be submitted. Instead, Sarissa will + * scan the form and make an appropriate AJAX request, also adding a parameter + * to signal to the server that this is an AJAX call. The parameter is + * constructed as Sarissa.REMOTE_CALL_FLAG = "=true" so you can change the name in your webpage + * simply by assigning another value to Sarissa.REMOTE_CALL_FLAG. If JavaScript is not supported + * the form will be submitted normally. + * @memberOf Sarissa + * @param {HTMLFormElement} oForm the form submition to emulate + * @param {DOMElement} oTargetElement the element to update + * @param {XSLTProcessor} xsltproc (optional) the transformer to use on the returned + * content before updating the target element with it + * @param {Function} callback (optional) a Function object to execute once the update is finished successfuly, called as callback(oNode, oTargetElement). + * In case an exception occurs during excecution and a callback function was provided, the exception is cought and the callback is called as + * callback(oForm, oTargetElement, exception) + */ +Sarissa.updateContentFromForm = function(oForm, oTargetElement, xsltproc, callback) { + try{ + Sarissa.updateCursor(oTargetElement, "wait"); + // build parameters from form fields + var params = Sarissa.formToQueryString(oForm) + "&" + Sarissa.REMOTE_CALL_FLAG + "=true"; + var xmlhttp = new XMLHttpRequest(); + var bUseGet = oForm.getAttribute("method") && oForm.getAttribute("method").toLowerCase() == "get"; + if(bUseGet) { + xmlhttp.open("GET", oForm.getAttribute("action")+"?"+params, true); + } + else{ + xmlhttp.open('POST', oForm.getAttribute("action"), true); + xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); + xmlhttp.setRequestHeader("Content-length", params.length); + xmlhttp.setRequestHeader("Connection", "close"); + } + xmlhttp.onreadystatechange = function() { + try{ + if (xmlhttp.readyState == 4) { + var oDomDoc = xmlhttp.responseXML; + if(oDomDoc && Sarissa.getParseErrorText(oDomDoc) == Sarissa.PARSED_OK){ + Sarissa.updateContentFromNode(xmlhttp.responseXML, oTargetElement, xsltproc); + if(callback){ + callback(oForm, oTargetElement); + } + } + else{ + throw Sarissa.getParseErrorText(oDomDoc); + } + } + } + catch(e){ + if(callback){ + callback(oForm, oTargetElement, e); + } + else{ + throw e; + } + } + }; + xmlhttp.send(bUseGet?"":params); + } + catch(e){ + Sarissa.updateCursor(oTargetElement, "auto"); + if(callback){ + callback(oForm, oTargetElement, e); + } + else{ + throw e; + } + } + return false; +}; +Sarissa.FUNCTION_NAME_REGEXP = new RegExp("");//new RegExp("function\\s+(\\S+)\\s*\\((.|\\n)*?\\)\\s*{"); +/** + * Get the name of a function created like: + *

function functionName(){}
+ * If a name is not found and the bForce parameter is true, + * attach the function to the window object with a new name and + * return that + * @param {Function} oFunc the function object + * @param {boolean} bForce whether to force a name under the window context if none is found + */ +Sarissa.getFunctionName = function(oFunc, bForce){ + //alert("Sarissa.getFunctionName oFunc: "+oFunc); + var name; + if(!name){ + if(bForce){ + // attach to window object under a new name + name = "SarissaAnonymous" + Sarissa._getUniqueSuffix(); + window[name] = oFunc; + } + else{ + name = null; + } + } + + //alert("Sarissa.getFunctionName returns: "+name); + if(name){ + window[name] = oFunc; + } + return name; +}; + +/** + * + */ +Sarissa.setRemoteJsonCallback = function(url, callback, callbackParam) { + if(!callbackParam){ + callbackParam = "callback"; + } + var callbackFunctionName = Sarissa.getFunctionName(callback, true); + var id = "sarissa_json_script_id_" + Sarissa._getUniqueSuffix(); + var oHead = document.getElementsByTagName("head")[0]; + var scriptTag = document.createElement('script'); + scriptTag.type = 'text/javascript'; + scriptTag.id = id; + scriptTag.onload = function(){ + // cleanUp + // document.removeChild(scriptTag); + }; + if(url.indexOf("?") != -1){ + url += ("&" + callbackParam + "=" + callbackFunctionName); + } + else{ + url += ("?" + callbackParam + "=" + callbackFunctionName); + } + scriptTag.src = url; + oHead.appendChild(scriptTag); + return id; +}; + +// EOF diff --git a/pacotes/cswclient/lib/scripts/sarissa_ieemu_xpath.js b/pacotes/cswclient/lib/scripts/sarissa_ieemu_xpath.js new file mode 100644 index 0000000..049013a --- /dev/null +++ b/pacotes/cswclient/lib/scripts/sarissa_ieemu_xpath.js @@ -0,0 +1,220 @@ +/** + * ==================================================================== + * About + * ==================================================================== + * Sarissa cross browser XML library - IE XPath Emulation + * @version 0.9.9.4 + * @author: Copyright 2004-2007 Emmanouil Batsis, mailto: mbatsis at users full stop sourceforge full stop net + * + * This script emulates Internet Explorer's selectNodes and selectSingleNode + * for Mozilla. Associating namespace prefixes with URIs for your XPath queries + * is easy with IE's setProperty. + * USers may also map a namespace prefix to a default (unprefixed) namespace in the + * source document with Sarissa.setXpathNamespaces + * + * ==================================================================== + * Licence + * ==================================================================== + * Sarissa is free software distributed under the GNU GPL version 2 (see gpl.txt) or higher, + * GNU LGPL version 2.1 (see lgpl.txt) or higher and Apache Software License 2.0 or higher + * (see asl.txt). This means you can choose one of the three and use that if you like. If + * you make modifications under the ASL, i would appreciate it if you submitted those. + * In case your copy of Sarissa does not include the license texts, you may find + * them online in various formats at http://www.gnu.org and + * http://www.apache.org. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY + * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +if(Sarissa._SARISSA_HAS_DOM_FEATURE && document.implementation.hasFeature("XPath", "3.0")){ + /** + *

SarissaNodeList behaves as a NodeList but is only used as a result to selectNodes, + * so it also has some properties IEs proprietery object features.

+ * @private + * @constructor + * @argument i the (initial) list size + */ + SarissaNodeList = function (i){ + this.length = i; + }; + /** + *

Set an Array as the prototype object

+ * @private + */ + SarissaNodeList.prototype = []; + /** + *

Inherit the Array constructor

+ * @private + */ + SarissaNodeList.prototype.constructor = Array; + /** + *

Returns the node at the specified index or null if the given index + * is greater than the list size or less than zero

+ *

Note that in ECMAScript you can also use the square-bracket + * array notation instead of calling item + * @argument i the index of the member to return + * @returns the member corresponding to the given index + * @private + */ + SarissaNodeList.prototype.item = function(i) { + return (i < 0 || i >= this.length)?null:this[i]; + }; + /** + *

Emulate IE's expr property + * (Here the SarissaNodeList object is given as the result of selectNodes).

+ * @returns the XPath expression passed to selectNodes that resulted in + * this SarissaNodeList + * @private + */ + SarissaNodeList.prototype.expr = ""; + /** dummy, used to accept IE's stuff without throwing errors */ + if(window.XMLDocument && (!XMLDocument.prototype.setProperty)){ + XMLDocument.prototype.setProperty = function(x,y){}; + } + /** + *

Programmatically control namespace URI/prefix mappings for XPath + * queries.

+ *

This method comes especially handy when used to apply XPath queries + * on XML documents with a default namespace, as there is no other way + * of mapping that to a prefix.

+ *

Using no namespace prefix in DOM Level 3 XPath queries, implies you + * are looking for elements in the null namespace. If you need to look + * for nodes in the default namespace, you need to map a prefix to it + * first like:

+ *
Sarissa.setXpathNamespaces(oDoc, "xmlns:myprefix'http://mynsURI'");
+ *

Note 1 : Use this method only if the source document features + * a default namespace (without a prefix), otherwise just use IE's setProperty + * (moz will rezolve non-default namespaces by itself). You will need to map that + * namespace to a prefix for queries to work.

+ *

Note 2 : This method calls IE's setProperty method to set the + * appropriate namespace-prefix mappings, so you dont have to do that.

+ * @param oDoc The target XMLDocument to set the namespace mappings for. + * @param sNsSet A whilespace-seperated list of namespace declarations as + * those would appear in an XML document. E.g.: + * "xmlns:xhtml='http://www.w3.org/1999/xhtml' + * xmlns:'http://www.w3.org/1999/XSL/Transform'" + * @throws An error if the format of the given namespace declarations is bad. + */ + Sarissa.setXpathNamespaces = function(oDoc, sNsSet) { + //oDoc._sarissa_setXpathNamespaces(sNsSet); + oDoc._sarissa_useCustomResolver = true; + var namespaces = sNsSet.indexOf(" ")>-1?sNsSet.split(" "):[sNsSet]; + oDoc._sarissa_xpathNamespaces = []; + for(var i=0;i < namespaces.length;i++){ + var ns = namespaces[i]; + var colonPos = ns.indexOf(":"); + var assignPos = ns.indexOf("="); + if(colonPos > 0 && assignPos > colonPos+1){ + var prefix = ns.substring(colonPos+1, assignPos); + var uri = ns.substring(assignPos+2, ns.length-1); + oDoc._sarissa_xpathNamespaces[prefix] = uri; + }else{ + throw "Bad format on namespace declaration(s) given"; + } + } + }; + /** + * @private Flag to control whether a custom namespace resolver should + * be used, set to true by Sarissa.setXpathNamespaces + */ + XMLDocument.prototype._sarissa_useCustomResolver = false; + /** @private */ + XMLDocument.prototype._sarissa_xpathNamespaces = []; + /** + *

Extends the XMLDocument to emulate IE's selectNodes.

+ * @argument sExpr the XPath expression to use + * @argument contextNode this is for internal use only by the same + * method when called on Elements + * @returns the result of the XPath search as a SarissaNodeList + * @throws An error if no namespace URI is found for the given prefix. + */ + XMLDocument.prototype.selectNodes = function(sExpr, contextNode, returnSingle){ + var nsDoc = this; + var nsresolver; + if(this._sarissa_useCustomResolver){ + nsresolver = function(prefix){ + var s = nsDoc._sarissa_xpathNamespaces[prefix]; + if(s){ + return s; + } + else { + throw "No namespace URI found for prefix: '" + prefix+"'"; + } + }; + } + else{ + nsresolver = this.createNSResolver(this.documentElement); + } + var result = null; + if(!returnSingle){ + var oResult = this.evaluate(sExpr, + (contextNode?contextNode:this), + nsresolver, + XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); + var nodeList = new SarissaNodeList(oResult.snapshotLength); + nodeList.expr = sExpr; + for(var i=0;iExtends the Element to emulate IE's selectNodes

+ * @argument sExpr the XPath expression to use + * @returns the result of the XPath search as an (Sarissa)NodeList + * @throws An + * error if invoked on an HTML Element as this is only be + * available to XML Elements. + */ + Element.prototype.selectNodes = function(sExpr){ + var doc = this.ownerDocument; + if(doc.selectNodes){ + return doc.selectNodes(sExpr, this); + } + else{ + throw "Method selectNodes is only supported by XML Elements"; + } + }; + /** + *

Extends the XMLDocument to emulate IE's selectSingleNode.

+ * @argument sExpr the XPath expression to use + * @argument contextNode this is for internal use only by the same + * method when called on Elements + * @returns the result of the XPath search as an (Sarissa)NodeList + */ + XMLDocument.prototype.selectSingleNode = function(sExpr, contextNode){ + var ctx = contextNode?contextNode:null; + return this.selectNodes(sExpr, ctx, true); + }; + /** + *

Extends the Element to emulate IE's selectSingleNode.

+ * @argument sExpr the XPath expression to use + * @returns the result of the XPath search as an (Sarissa)NodeList + * @throws An error if invoked on an HTML Element as this is only be + * available to XML Elements. + */ + Element.prototype.selectSingleNode = function(sExpr){ + var doc = this.ownerDocument; + if(doc.selectSingleNode){ + return doc.selectSingleNode(sExpr, this); + } + else{ + throw "Method selectNodes is only supported by XML Elements"; + } + }; + Sarissa.IS_ENABLED_SELECT_NODES = true; +} \ No newline at end of file diff --git a/pacotes/cswclient/lib/xml/csw-hosts.xml b/pacotes/cswclient/lib/xml/csw-hosts.xml new file mode 100644 index 0000000..a3bb2e8 --- /dev/null +++ b/pacotes/cswclient/lib/xml/csw-hosts.xml @@ -0,0 +1,8 @@ + diff --git a/pacotes/cswclient/lib/xml/cswclient.xml b/pacotes/cswclient/lib/xml/cswclient.xml new file mode 100644 index 0000000..f73b07b --- /dev/null +++ b/pacotes/cswclient/lib/xml/cswclient.xml @@ -0,0 +1,65 @@ +
+ +
+
+
+
+

Simple CSW Client

+
+ + + +

+ + + + +

+ + + + + +

+
+ +
+
+
+
+
+
+
+ +
+
+
+

+

+ +
diff --git a/pacotes/cswclient/lib/xml/defaults.xml b/pacotes/cswclient/lib/xml/defaults.xml new file mode 100644 index 0000000..c54ddbe --- /dev/null +++ b/pacotes/cswclient/lib/xml/defaults.xml @@ -0,0 +1,14 @@ + +2.0.2 +10 +1 +application/xml +http://www.opengis.net/cat/csw/2.0.2 + +results +AnyText + + +ASC + + diff --git a/pacotes/cswclient/lib/xsl/csw-metadata.xsl b/pacotes/cswclient/lib/xsl/csw-metadata.xsl new file mode 100644 index 0000000..5b215d4 --- /dev/null +++ b/pacotes/cswclient/lib/xsl/csw-metadata.xsl @@ -0,0 +1,448 @@ + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+

Metadata

+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+

Metadata author

+ + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + +
+

Identification info

+ + + + + + + + + + + + + + + + + + + + + + + + +
Abstract: + +
+ + +
+
+ + + +
+

Point of Contact

+ + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + +
+

Geographic box

+
+ + + + + + + + + + + + +
North bound latitude
+
West bound longitude
+
East bound longitude
+
South bound latitude
+
+
+
+
+ + + +
+

Distribution info

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Download: + + + + + +
Esri ArcIms: + + + + + +
OGC-WMS: + + javascript:void(window.open(' + + ')) + + + +
OGC-WMS Capabilities: + + + + + +
+
+
+ + + + + + + + + + + + +
+

Identification info

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Abstract:
+ + +
+
+ + + + + + + + + +
+

Geographic box

+ + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + +

+ + + + + + + + + + + + + + + + + + + : + + + + + + + + + + diff --git a/pacotes/cswclient/lib/xsl/csw-results.xsl b/pacotes/cswclient/lib/xsl/csw-results.xsl new file mode 100644 index 0000000..fbd777a --- /dev/null +++ b/pacotes/cswclient/lib/xsl/csw-results.xsl @@ -0,0 +1,146 @@ + + + + + + + javascript:(csw_client.getRecords + (' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ + + + +

+ + + + + + ')) + + << previous + + + || + + + + + + ')) + + next >> + + +

+
+ +

Total records returned: +(of ) +

+ +
+
    + + + + +
  1. + Title: + + + javascript:(csw_client.getRecordById + (' + + ')) + + + + + + + ... + + + +
    + +
    + Keywords: + + + , + + + +
    +
  2. +
    +
+
+
+ + + + + + + + ... + + + + + + Abstract: + + ... + + + javascript:(csw_client.getRecordById + (' + + ')) + + more + + + +
diff --git a/pacotes/cswclient/lib/xsl/getrecordbyid.xsl b/pacotes/cswclient/lib/xsl/getrecordbyid.xsl new file mode 100644 index 0000000..1cb6abd --- /dev/null +++ b/pacotes/cswclient/lib/xsl/getrecordbyid.xsl @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + full + + + + \ No newline at end of file diff --git a/pacotes/cswclient/lib/xsl/getrecords.xsl b/pacotes/cswclient/lib/xsl/getrecords.xsl new file mode 100644 index 0000000..87f472f --- /dev/null +++ b/pacotes/cswclient/lib/xsl/getrecords.xsl @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + summary + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pacotes/cswclient/lib/xsl/prettyxml.xsl b/pacotes/cswclient/lib/xsl/prettyxml.xsl new file mode 100644 index 0000000..a74f028 --- /dev/null +++ b/pacotes/cswclient/lib/xsl/prettyxml.xsl @@ -0,0 +1,134 @@ + + + + + + + + + + +
+

XML presentation

+
+ +
+
+ + + + + + + + + +
+ +
+ +
+
+
+ +
+ + + + + + + + + + + + +
+
+ + + + + < + + + + > + + + + + + + </ + + > + + + + + + + < + + + + + + /> + + + + + + + + + + + = + + " + + " + + + + + + + + + + xmlns + + : + + + = + + " + + " + + + + + +
+ -- libgit2 0.21.2