MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /proc/self/root/usr/lib/python2.4/site-packages/_xmlplus/dom/ext/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/lib/python2.4/site-packages/_xmlplus/dom/ext/c14n.pyo
mò
áw2>c@sdZdZdkZdklZydklZWndfd„ƒYZnXydkZeZWne	j
odkZnXd„Z
d„Zd	„Zd
„Z
edƒ\ZZZd„Zd
„Zd„Zd„Zdfd„ƒYZdd„ZdS(s¼XML Canonicalization

This module generates canonical XML of a document or element.
    http://www.w3.org/TR/2001/REC-xml-c14n-20010315
and includes a prototype of exclusive canonicalization
    http://www.w3.org/Signature/Drafts/xml-exc-c14n

Requires PyXML 0.7.0 or later.

Known issues if using Ft.Lib.pDomlette:
    1. Unicode
    2. does not white space normalize attributes of type NMTOKEN and ID?
    3. seems to be include "
" after importing external entities?

Note, this version processes a DOM tree, and consequently it processes
namespace nodes as attributes, not from a node's namespace axis. This
permits simple document and element canonicalization without
XPath. When XPath is used, the XPath result node list is passed and used to
determine if the node is in the XPath result list, but little else.

Authors:
    "Joseph M. Reagle Jr." <reagle@w3.org>
    "Rich Salz" <rsalz@zolera.com>

$Date: 2003/01/25 11:41:21 $ by $Author: loewis $
s*Copyright 2001, Zolera Systems Inc.  All Rights Reserved.
Copyright 2001, MIT. All Rights Reserved.

Distributed under the terms of:
  Python 2.0 License or later.
  http://www.python.org/2.0.1/license.html
or
  W3C Software License
  http://www.w3.org/Consortium/Legal/copyright-software-19980720
N(sNode(sXMLNStXMLNScBstZdZdZRS(Nshttp://www.w3.org/2000/xmlns/s$http://www.w3.org/XML/1998/namespace(t__name__t
__module__tBASEtXML(((t9/usr/lib/python2.4/site-packages/_xmlplus/dom/ext/c14n.pyR-scCs|io|iiƒpgS(N(tEt
attributestvalues(R((Rt<lambda>6scCs|ipgS(N(Rt
childNodes(R((RR	7scCs|iidƒS(Ntxmlns(tntnamet
startswith(R((RR	8scCs
|idjS(N(RtunsuppressedPrefixestNone(R((RR	9sicCs7t|i|iƒ}|o|Snt|i|iƒS(sB_sorter(n1,n2) -> int
    Sorting predicate for non-NS attributes.N(tcmptn1tnamespaceURItn2tit	localName(RRR((Rt_sorter@s
cCsG|ddjodSn|ddjodSnt|d|dƒS(sY_sorter_ns((n,v),(n,v)) -> int
    "(an empty namespace URI is lexicographically least)."iRiÿÿÿÿiN(RRR(RR((Rt
_sorter_nsIscCs±|idƒo|d}n|idƒo|d}n|djo|idd	gjp||ijp
||jodSnx&|D]}||ijodSq‹q‹WdS(
s~_utilized(n, node, other_attrs, unsuppressedPrefixes) -> boolean
    Return true if that nodespace is utilized within the nodesxmlns:iRits#defaultiiN(RRtnodetprefixRRtother_attrstattr(RRRRR((Rt	_utilizedQs@cCs|djp
||jS(N(tsubsetRR(RR((RR	ast_implementationcBs­tZdZhZd„Zd„Zd„Zeeei<d„Z	e	eei
<e	eei<d„Zeeei
<d„Zeeei<d„Zgd„Zeeei<RS(	sƒImplementation class for C14N. This accompanies a node during it's
    processing and includes the parameters and processing state.cKs2||_|idƒ|_|iddƒ|_|idƒ|_|idhdti<dti	<ƒ}|hdd<hf|_|i
tijo|i|ƒn„|i
tijoJt|_t|ƒp|i|ƒq.|i|ƒ}|i||ƒn'|i
tijontt|ƒ‚d	S(
s"Create and run the implementation.RtcommentsiRtnsdicttxmlRRN(twritetselftkwtgetRR!RRRRR"tstateRtnodeTypetNodet
DOCUMENT_NODEt_do_documenttELEMENT_NODEt_Elementt
documentOrdert
_inclusivet_do_elementt_inherit_contextt	inheritedtDOCUMENT_TYPE_NODEt	TypeErrortstr(R%RR$R&R3R"((Rt__init__js$	*	
cCs¨ttt|ƒƒ}g|i}}x||ot|it	i
joaxQttt|ƒƒD]:}|i}||jo|i|ƒ|i|ƒqXqXW|i}q(W|S(sÅ_inherit_context(self, node) -> list
        Scan ancestors of attribute and namespace context.  Used only
        for single element node canonicalization, not for subset
        canonicalization.N(tfiltert
_IN_XML_NSt_attrsRtxmlattrst
parentNodeR3tparentR)R*R-taRRtappend(R%RR=R>R3RR;((RR2„s	

cCsÅt|_xµ|iD]ª}|itijo#t	|_|i
|ƒt|_q|itijo|i
|ƒq|itijo|i|ƒq|itijoqtt|ƒ‚qWdS(sË_do_document(self, node) -> None
        Process a document node. documentOrder holds whether the document
        element has been encountered such that PIs/comments can be written
        as specified.N(t_LesserElementR%R/RR
tchildR)R*R-R.R1t_GreaterElementtPROCESSING_INSTRUCTION_NODEt_do_pitCOMMENT_NODEt_do_commentR4R5R6(R%RRA((RR,™s	
	

cCsŽt|i|ƒpdSnti|iddƒ}ti|ddƒ}ti|ddƒ}ti|dd	ƒ}|o|i|ƒndS(
s“_do_text(self, node) -> None
        Process a text or CDATA node.  Render various special characters
        as their C14N entity representations.Nt&s&amp;t<s&lt;t>s&gt;s
s&#xD;(	t
_in_subsetR%RRtstringtreplacetdatatsR$(R%RRN((Rt_do_text°scCs­t|i|ƒpdSn|i}|itjo|dƒn|dƒ||iƒ|i	}|o|dƒ||ƒn|dƒ|itjo|dƒndS(sÎ_do_pi(self, node) -> None
        Process a PI node. Render a leading or trailing #xA if the
        document order of the PI is greater or lesser (respectively)
        than the document element.
        Ns
s<?t s?>(RJR%RRR$tWR/RBtnodeNameRMRNR@(R%RRNRQ((RRD¾s	

	

cCs“t|i|ƒpdSn|ioj|i}|itjo|dƒn|dƒ||i	ƒ|dƒ|it
jo|dƒqndS(sÝ_do_comment(self, node) -> None
        Process a comment node. Render a leading or trailing #xA if the
        document order of the comment is greater or lesser (respectively)
        than the document element.
        Ns
s<!--s-->(RJR%RRR!R$RQR/RBRMR@(R%RRQ((RRFÒs
	


cCs½|i}|dƒ||ƒ|dƒti|ddƒ}ti|ddƒ}ti|ddƒ}ti|d	d
ƒ}ti|ddƒ}ti|d
dƒ}||ƒ|dƒdS(s;'_do_attr(self, node) -> None
        Process an attribute.RPs="RGs&amp;RHs&lt;t"s&quot;s	s&#x9s
s&#xAs
s&#xDN(R%R$RQRRKRLtvalueRN(R%RRTRNRQ((Rt_do_attrãs	



cCsœ|id|idiƒ|idiƒ}}}|iƒ}h}	|}t
|i|ƒ}xØt|ƒD]Ê}|itijo1|i}|djo
d}n|i||<nt|itijo<t|ƒp|o$t
|i|ƒo||	|i<q*n%t
|i|ƒo|i|ƒn|i|	ƒqmW|id
}
}
|oÚ|i}
|
dƒ|
|
ƒg}xæ|iƒD]Ø\}}|djo?|tidgjo)|i!dƒtidd
gjoq‚n|dd	gjo|d
gjoq‚n||f|iƒjo=t|ƒpt"||||i#ƒo|i||fƒq‚q‚W|i$t%ƒx.|D]&\}}|i&||ƒ|||<qrWt|ƒpt
|i|i'ƒo|i(|	i)ƒƒn|i(|i)ƒƒ|i$t*ƒx$|D]}|i&|i|i+ƒqþW|
dƒn|i|||f}|_x+t,|ƒD]}t.i/|i0||ƒqUW||_|
o|
d|
ƒnd
S(sh_do_element(self, node, initial_other_attrs = []) -> None
        Process an element (and its children).iiisxmlns:RRHRs	xmlns:xmlR#s$http://www.w3.org/XML/1998/namespaceRIs</%s>N(1R%R(tcopyt	ns_parenttns_renderedt	xml_attrstns_localtxml_attrs_localtinitial_other_attrsRRJRRt	in_subsetR:R>RRRRRRt	nodeValueRR0R?tupdateR$RRQR
tns_to_rendertitemstvR'RRtsortRRUR<textendRRRTt	_childrentcR thandlersR)(R%RR\RYRWR]R(RXR`R[RQR>RfR
RRRbRZ((RR1õsj5
	

'	


E#?
$

	(RRt__doc__RgR7R2R,R*R+ROt	TEXT_NODEtCDATA_SECTION_NODERDRCRFRERUR1R-(((RR cs 			
	


	
	
	YcKsW|ott||if|ƒn0tiƒ}tt||if|ƒ|iƒSdS(s™Canonicalize(node, output=None, **kw) -> UTF-8

    Canonicalize a DOM document/element node and all descendents.
    Return the text; if output is specified then output.write will
    be called to output the text and None will be returned
    Keyword parameters:
        nsdict: a dictionary of prefix:uri namespace entries
                assumed to exist in the surrounding context
        comments: keep comments if non-zero (default is 0)
        subset: Canonical XML subsetting resulting from XPath
                (default is [])
        unsuppressedPrefixes: do exclusive C14N, and this specifies the
                prefixes that should be inherited.
    N(	toutputtapplyR RR$R&tStringIORNtgetvalue(RRkR&RN((RtCanonicalizeQs(Rht
_copyrightRKtxml.domR*txml.nsRt	cStringIORmtImportErrorR:ReR9R0trangeR@R.RBRRRRJR RRo(RsReRRpR*RR:RRKR.RJRR0R R9RmRoR@RB((Rt?s.	
	
									î

Anon7 - 2021