From alessandro.maraschini at datamat.it Tue Oct 3 16:53:23 2006 From: alessandro.maraschini at datamat.it (Alessandro Maraschini) Date: Tue, 03 Oct 2006 16:53:23 +0200 Subject: [XML-SIG] python and XSLT Message-ID: <1159887203.16854.508.camel@grid.datamat.it> Hi all, I am using python2.2 and trying to convert an xml document into a plain text using a stylesheet and using python standard xmlplus package. While the stylesheet perfectly works with a similar approach in cpp, I'm facing a problem in python when parsing some "range" values: here follows the piece of code inside the stylesheet regarding range values: [...] > >= [...] and here the piece of code where the exception arises: [...] processor = Processor() processor.appendStylesheetUri(xsltFile) processor.runUri(jsdlFile) here the exception I get: [grid] /home/maraska/Jsdl/python > ./jsdl.py jsdl2jdl.xslt jsdl_rask.xml Traceback (most recent call last): File "./jsdl.py", line 58, in ? print jsdl.applyXSLT() File "./jsdl.py", line 45, in applyXSLT return self.processor.runUri(self.jsdlFile) File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/Processor.py", line 175, in runUri writer, uri, outputStream) File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/Processor.py", line 283, in execute self.applyTemplates(context, None) File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/Processor.py", line 304, in applyTemplates found = sty.applyTemplates(context, mode, self, params) File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/Stylesheet.py", line 452, in applyTemplates template.instantiate(context, processor, params) File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/TemplateElement.py", line 117, in instantiate context = child.instantiate(context, processor)[0] File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/ApplyTemplatesElement.py", line 86, in instantiate processor.applyTemplates(context, mode, params) File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/Processor.py", line 304, in applyTemplates found = sty.applyTemplates(context, mode, self, params) File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/Stylesheet.py", line 452, in applyTemplates template.instantiate(context, processor, params) File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/TemplateElement.py", line 117, in instantiate context = child.instantiate(context, processor)[0] File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/ForEachElement.py", line 64, in instantiate child.instantiate(context, processor)[0] File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/ApplyTemplatesElement.py", line 86, in instantiate processor.applyTemplates(context, mode, params) File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/Processor.py", line 304, in applyTemplates found = sty.applyTemplates(context, mode, self, params) File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/Stylesheet.py", line 452, in applyTemplates template.instantiate(context, processor, params) File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/TemplateElement.py", line 117, in instantiate context = child.instantiate(context, processor)[0] File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/ApplyTemplatesElement.py", line 86, in instantiate processor.applyTemplates(context, mode, params) File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/Processor.py", line 304, in applyTemplates found = sty.applyTemplates(context, mode, self, params) File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/Stylesheet.py", line 452, in applyTemplates template.instantiate(context, processor, params) File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/TemplateElement.py", line 117, in instantiate context = child.instantiate(context, processor)[0] File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/ValueOfElement.py", line 40, in instantiate result = self._expr.evaluate(context) File "/usr/lib/python2.2/site-packages/_xmlplus/xpath/ParsedExpr.py", line 95, in evaluate expanded[0], expanded[1]) xml.xpath.RuntimeException: Variable undefined: ("None", "VARNAME"). Any chance you have got an idea? Thank you in advance for your support! cheers, Alessandro -- ----- Alessandro Maraschini Grid R&D Group Government and Institutions Division DATAMAT S.p.A. - a Finmeccanica company Via Laurentina, 760 ?? I - 00143 Rome ?? Italy http://www.datamat.it mailto: alessandro.maraschini at datamat.it phone: +39 06 5027 4501 (direct) +39 06 5027 2211 (secretary) fax: +39 06 5027 4330 From bellis at baldcom.net Thu Oct 5 23:58:42 2006 From: bellis at baldcom.net (Bryan Ellis) Date: Thu, 5 Oct 2006 17:58:42 -0400 Subject: [XML-SIG] How to parse an XPath containing resolve-QName Message-ID: <005701c6e8c9$6daeca80$0100a8c0@CVDEV2> Trying to execute the following xpath as defined by the w3c group in their document: XML Schema Patterns for Common Data Structures Version 1.0 http://www.w3.org/2002/ws/databinding/edcopy/basic/basic.html Program: ----- import xml.dom.minidom from xml import xpath sch = xml.dom.minidom.Document sch = xml.dom.minidom.parse("C:\Files\Python\GetInvType.xsd").documentElement nsContext = xml.xpath.Context.Context(sch) nsContext.setNamespaces({"xs" : "http://www.w3.org/2001/XMLSchema"}) xPath ='''//xs:restriction[@base/resolve-QName(.,..) = xs:QName('xs:decimal')]/xs:pattern''' elem = xpath.Compile(xPath) nodes = elem.evaluate(nsContext) Error: -------- xml.xpath.RuntimeException: There is an internal bug in 4XPath. Please report this error code to support at 4suite.org: Traceback (most recent call last): File "C:\Python24\Lib\site-packages\_xmlplus\xpath\__init__.py", line 76, in Compile return parser.new().parse(expr) File "C:\Python24\Lib\site-packages\_xmlplus\xpath\pyxpath.py", line 322, in parse raise SyntaxError(e.pos, e.msg, str) SyntaxError: SyntaxError[@ char 6: Could not match Step] Traceback (innermost last): File "c:\Files\Python\TestXPath.py", line 1, in ? import xml.dom.minidom File "c:\Files\Python\TestXPath.py", line 9, in ? elem = xpath.Compile(xPath) File "C:\Python24\Lib\site-packages\_xmlplus\xpath\__init__.py", line 83, in Compile raise RuntimeException(RuntimeException.INTERNAL, stream.getvalue()) Any help? Thanks! .Bryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20061005/a8dfaf5b/attachment.htm From sergio at sergiomb.no-ip.org Sun Oct 8 06:35:09 2006 From: sergio at sergiomb.no-ip.org (Sergio Monteiro Basto) Date: Sun, 08 Oct 2006 05:35:09 +0100 Subject: [XML-SIG] manual reference for pyxml Message-ID: <1160282109.21815.0.camel@localhost.localdomain> hi , where I can find references for xml.dom.ext.reader.Sax ? Thanks, From content-filter at makana.gov.za Mon Oct 9 11:34:52 2006 From: content-filter at makana.gov.za (WorkgroupMail Content Filter) Date: Mon, 09 Oct 2006 11:34:52 +0200 Subject: [XML-SIG] QUARANTINED: Returned mail: Data format error Message-ID: The message "Returned mail: Data format error" from , sent on 10/9/2006 11:33 was quarantined because it contained either an executable file, a batch file or a screen saver file. All of these types of attachments are considered security risks. Please consult your mail administrator who can release the message. From jvines at arl.army.mil Tue Oct 10 20:24:20 2006 From: jvines at arl.army.mil (Vines, John (Civ, ARL/CISD)) Date: Tue, 10 Oct 2006 14:24:20 -0400 Subject: [XML-SIG] Creating an Entity reference Message-ID: All, I'm having a bit of an issue understanding how to create an entity . My understanding is to create an instance of a document and use the "createEntityReference(name)" method to create the entity. At present I am using the code below to generate my XML document: #Python 2.4.3 from xml.dom import getDOMImplementation impl = getDOMImplementation() doctype = impl.createDocumentType( 'Xdmf', None, 'Xdmf.dtd' ) self.xml_doc = impl.createDocument(None, "Xdmf", doctype) self.root = self.xml_doc.documentElement self.xml_doc.appendChild( self.root ) How would I modify it to add an entity reference? Thanks in advance, John -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20061010/39b0fe39/attachment.html From www.python.org at squirrelblue.org Tue Oct 10 22:24:19 2006 From: www.python.org at squirrelblue.org (www.python.org at squirrelblue.org) Date: Tue, 10 Oct 2006 21:24:19 +0100 Subject: [XML-SIG] Creating an Entity reference In-Reply-To: References: Message-ID: <200610102124.19831.www.python.org@squirrelblue.org> On Tuesday 10 October 2006 19:24, Vines, John (Civ, ARL/CISD) wrote: # I'm having a bit of an issue understanding how to create an # entity . My understanding is to create an instance of a document and # use the "createEntityReference(name)" method to create the entity. # from xml.dom import getDOMImplementation # # impl = getDOMImplementation() # doctype = impl.createDocumentType( 'Xdmf', None, 'Xdmf.dtd' ) # self.xml_doc = impl.createDocument(None, "Xdmf", doctype) # self.root = self.xml_doc.documentElement # self.xml_doc.appendChild( self.root ) On my system, getDOMImplementation returns the minidom implementation: Python 2.4.2 (#2, Nov 20 2005, 17:04:48) [GCC 4.0.3 20051111 (prerelease) (Debian 4.0.2-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from xml.dom import getDOMImplementation >>> impl = getDOMImplementation() >>> impl Which does not appear to have a createEntityReference() method: >>> doc = impl.createDocument(None, 'a', None) >>> [k for k in dir(doc) if k.startswith('create')] ['createAttribute', 'createAttributeNS', 'createCDATASection', 'createComment', 'createDocumentFragment', 'createElement', 'createElementNS', 'createProcessingInstruction', 'createTextNode'] The 4DOM implementation, however, does have such a method: >>> newImpl = getDOMImplementation('4DOM') >>> newImpl >>> doc = newImpl.createDocument(None, 'a', None) >>> hasattr(doc, 'createEntityReference') True Which you use as one might expect: >>> lt = doc.createEntityReference('lt') >>> doc.documentElement.appendChild(lt) >>> from xml.dom.ext import Print # 4DOM does not have a toxml() method >>> from StringIO import StringIO >>> buf = StringIO() >>> Print(doc, buf) >>> buf.seek(0) >>> print buf.read() < Another DOM implementation that you might be interested in is pxdom: http://www.doxdesk.com/software/py/pxdom.html All these DOM implementations have their strengths and weaknesses. Hope that helped, --anjansamanta From content-filter at makana.gov.za Thu Oct 12 11:46:52 2006 From: content-filter at makana.gov.za (WorkgroupMail Content Filter) Date: Thu, 12 Oct 2006 11:46:52 +0200 Subject: [XML-SIG] QUARANTINED: Delivery reports about your e-mail Message-ID: The message "Delivery reports about your e-mail" from Mail Delivery Subsystem, sent on 10/12/2006 11:45 was quarantined because it contained either an executable file, a batch file or a screen saver file. All of these types of attachments are considered security risks. Please consult your mail administrator who can release the message. From hqllka at vedder.com.au Sat Oct 14 12:49:30 2006 From: hqllka at vedder.com.au (Frida Merritt) Date: Sat, 14 Oct 2006 12:49:30 +0200 Subject: [XML-SIG] toxin Message-ID: <4530C0BA.9040704@bmwitmond.co.uk> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/xml-sig/attachments/20061014/0fc537f3/attachment.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: junior college.gif Type: image/gif Size: 10321 bytes Desc: not available Url : http://mail.python.org/pipermail/xml-sig/attachments/20061014/0fc537f3/attachment.gif From uche at ogbuji.net Sat Oct 21 02:12:19 2006 From: uche at ogbuji.net (Uche Ogbuji) Date: Fri, 20 Oct 2006 18:12:19 -0600 Subject: [XML-SIG] ANN: 4Suite XML 1.0 Message-ID: <453965E3.7060506@ogbuji.net> Today we release 4Suite XML 1.0, now available from Sourceforge and ftp.4suite.org. Thanks to all the testers, there are a number of important fixes and improvements since 1.0rc4, and we strongly recommend upgrade from all previous versions. 4Suite consists of three separate packages: 4Suite XML - XML, XPath, XSLT, related technologies and support libraries 4Suite RDF - RDF processing libraries and stand-alone DBMS 4Suite Repository - XML and RDF repository This is a release of only the first component. 4Suite XML is a comprehensive library for XML processing. It is implemented in Python and C and supports XML (SAX-like and DOM-like), XPath, XSLT, RELAX NG, XUpdate, XInclude, XPointer, and more. Many users will be able to use easy_install. See the bottom of this announcement for more information. General information: http://4suite.org/ http://uche.ogbuji.net/tech/4Suite/ https://sourceforge.net/projects/foursuite/ Source code, Python eggs, Windows installers, and documentation: ftp://ftp.4suite.org/pub/4Suite/ (primary) http://sourceforge.net/project/showfiles.php?group_id=39954 (secondary) http://cheeseshop.python.org/pypi/4Suite-XML/ (alternative) You only need to download one distribution (source, egg, or .exe). Installation requirements and other details: http://4suite.org/docs/README Installation: You can install without any separate download using: easy_install 4Suite-XML For more information see: http://peak.telecommunity.com/DevCenter/EasyInstall Otherwise use one of the packages listed above, or one provided by your software distributor. Documentation: Documentation is distributed separately from the source and eggs. Windows installers come with documentation; no separate download needed. The 4Suite XML core manual is included in the documentation. It can be browsed online at http://4suite.org/docs/CoreManual.xml -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://fourthought.com http://copia.ogbuji.net http://4Suite.org Articles: http://uche.ogbuji.net/tech/publications/ From harry.liljestrom at saunalahti.fi Tue Oct 24 07:52:22 2006 From: harry.liljestrom at saunalahti.fi (=?ISO-8859-1?Q?Harry_Liljestr=F6m?=) Date: Tue, 24 Oct 2006 08:52:22 +0300 (EEST) Subject: [XML-SIG] Python library for XSLT 2.0 Message-ID: <18011379.203221161669142425.JavaMail.harry.liljestrom@saunalahti.fi> Hi, Can I find a Python implementation of a Style Sheet library for XSLT 2.0? I already found libxslt which implements XSLT 1.0. Thanks, Harry Liljestr?m From lyris-admin at lists.csudh.edu Sat Oct 28 13:32:37 2006 From: lyris-admin at lists.csudh.edu (Lyris ListManager) Date: Sat, 28 Oct 2006 04:32:37 -0700 Subject: [XML-SIG] your subscribe request Message-ID: Re: your subscribe request > subscribe We have received your request to subscribe to the private mailing list 'students'. Your request has been forwarded to the mailing list administrator. Because this mailing list is private, you must be approved by a mailing list administrator before you can become a member of this mailing list. From aisola at novacoast.com Tue Oct 31 20:43:49 2006 From: aisola at novacoast.com (Anthony Isola) Date: Tue, 31 Oct 2006 11:43:49 -0800 Subject: [XML-SIG] cannot find module Message-ID: <454736F50200008500003344@mail.novacoast.com> Hi, I am a developer and I downloaded PyXML 0.8.4. I ran python setup.py build and then python setup.py install. I then attempted to run some of the test scripts and additionally some of my own scripts which all complain: ImportError: No module named xml I am running SLES version 9 or 10, probably 10. Any help would be appreciated. Thanks, Anthony