xml-namespaces

XSLT does not work when I include xmlns=“http://www.sitemaps.org/schemas/sitemap/0.9”

两盒软妹~` 提交于 2019-12-09 14:42:35
问题 My Google sitemap renders well through XSLT fine without the xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" in the < urlset > element, however when included, my foreach statement doesn't work and nothing renders in the template. My code's below. Thanks for your help. XML <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>{site_url}</loc> <lastmod>{current_time format="%Y-%m-%d"}</lastmod> <changefreq>monthly</changefreq> <priority>0.5</priority> </url> </urlset> XSL

XHTML namespace issues with cssselect in lxml

﹥>﹥吖頭↗ 提交于 2019-12-09 13:46:24
问题 I have problems using cssselect with a XHTML (or XML with namespace). Although the documentation says how to use namespace in csselect I do not understand it: cssselect namespaces My Input XHTML string: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Teststylesheet</title> <style type="text/css"> /*<![CDATA[*/ ol{margin:0;padding:0} /*]]>*/ </style> </head> <body> </body> <

C# - Add XML Namespace (xmlns) tag to document

痞子三分冷 提交于 2019-12-09 12:19:27
问题 I'm creating an XML document using System.XML in C#. I'm almost done, but I need to add some similar to the following to the top of my document: <ABC xmlns="http://www.acme.com/ABC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" fileName="acmeth.xml" date="2011-09-16T10:43:54.91+01:00" origin="TEST" ref="XX_88888"> I need to add this just below where I have: <?xml version="1.0" encoding="UTF-8"?> I create this using the following code: XmlWriterSettings settings = new XmlWriterSettings

Python lxml iterfind w/ namespace but prefix=None

橙三吉。 提交于 2019-12-09 11:56:44
问题 I want to perform iterfind() for elements which have a namespace but no prefix. I'd like to call iterfind([tagname]) or iterfind([tagname], [namespace dict]) I don't care to enter the tag as follows every time: "{%s}tagname" % tree.nsmap[None] Details I'm running through an xml response from a Google API. The root node defines several namespaces, including one for which there is no prefix: xmlns="http://www.w3.org/2005/Atom" It looks as though when I try to search through my etree, everything

Either DOMParser or XMLSerializer is dropping my namespace declaration in IE9

一笑奈何 提交于 2019-12-09 03:16:46
问题 So I think there are probably cleaner solutions than what I am doing anyway, but I'm wondering if this is a known issue, if there's something obvious I'm doing wrong, etc... For reasons not worth describing, I have some Javascript code that, in one possible path, is loading XML from a string using DOMParser, then serializing it back to a string with XMLSerializer. The XML document is an XSL stylesheet. There are two xmlns elements in the main xsl:stylesheet tag: One which declares the xsl

Adding default namespace conditionally using xslt

流过昼夜 提交于 2019-12-08 09:09:22
问题 Requirement: Check whether a default namespace declaration xmlns="http://www.origoservices.com present in the request xml. If not, add the default namespace declaration. Sample Request xml 1: <message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <m_control> <control_timestamp>2014-11-05T09:30:38.308</control_timestamp> <retry_number>0</retry_number> <expected_response_type>synchronous</expected_response_type> <responder_id>Exchange Life 1</responder_id> </m_control> </message>

Intellisense not working when trying to define an xmlns in VS2012

≯℡__Kan透↙ 提交于 2019-12-08 08:03:41
问题 I am trying to add a namespace to one of my usercontrols in xaml. In visual studio 2010 I could just type xmlns:blahblah= and it would add the quotations and offer me a whole list of suggestions of assemblies to add as namespace definitions. In visual studio 2012 I start typing it out and I'm immediately getting xaml errors as I'm typing and no suggestions. The problem is, I don't know what the exact ones I need to add, so I'm a little dependent on the intellisense. Regular intellisense works

Getting value of an attribute within namespace

让人想犯罪 __ 提交于 2019-12-08 05:40:37
问题 I am trying to process the following XML: <rif:Rif xmlns:rif="rif" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" rif:numeroRif="XYZXYZXYZ"> <rif:Nombre>Nombre</rif:Nombre> <rif:AgenteRetencionIVA>SI</rif:AgenteRetencionIVA> <rif:ContribuyenteIVA>SI</rif:ContribuyenteIVA> <rif:Tasa /> </rif:Rif> An I am using the next code: XDocument doc = XDocument.Parse(result); var q = from item in doc.Descendants() let attributeType = item.Attribute("AgenteRetencionIVA").Value select item; I have

How to ingore namespace prefixes on VTD Xpath lookup

[亡魂溺海] 提交于 2019-12-08 05:22:50
问题 I'm building a VTD based XML Parsing engine in order to process files from several input systems. I'm currently trying to get values from tags with namespace prefix: <?xml version="1.0" encoding="UTF-8"?> <cli:clients xmlns declarations > <cli:client> <dat:name>CLIENT NAME</dat:name> <dat:age>1</dat:age> </cli:client> and querying the following Xpaths: //client/age/text() //client/name/text() How can I set VTD AutoPilot to ignore the namespace prefix? NOTE : I cannot change the xpaths as I

How to read an XML file with an undefined namespace with XMLReader?

妖精的绣舞 提交于 2019-12-08 03:02:23
问题 I'm relatively new to parsing XML files and am attempting to read a large XML file with XMLReader. <?xml version="1.0" encoding="UTF-8"?> <ShowVehicleRemarketing environment="Production" lang="en-CA" release="8.1-Lite" xsi:schemaLocation="http://www.starstandards.org/STAR /STAR/Rev4.2.4/BODs/Standalone/ShowVehicleRemarketing.xsd"> <ApplicationArea> <Sender> <Component>Component</Component> <Task>Task</Task> <ReferenceId>w5/cron</ReferenceId> <CreatorNameCode>CreatorNameCode</CreatorNameCode>