xml-namespaces

Trying to import XML children from one file to another

雨燕双飞 提交于 2019-12-01 06:29:24
问题 I have looked into this post and found that it is almost exactly what I need to do. However, I am not able to produce the output expected given the suggestion in this post. Basically, I am trying to import </parameter> elements from an XML ( $ManifestFile ) file that contains something like: <?xml version="1.0" encoding="utf-8"?> <plasterManifest schemaVersion="1.1" templateType="Project" xmlns="http://www.microsoft.com/schemas/PowerShell/Plaster/v1"> <metadata> <name>PlasterTestProject</name

Either DOMParser or XMLSerializer is dropping my namespace declaration in IE9

末鹿安然 提交于 2019-12-01 06:25:59
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 namespace, and another which declares a custom namespace that I use. (Call it "foo") In IE9, at least,

How can I handle XML namespaces in CSS Selectors or in jQuery?

醉酒当歌 提交于 2019-12-01 05:55:25
I use jQuery to parse an RSS feed. I can successfully get the RSS feed using AJAX: $.get("podcast.xml", function (data) { xml = $(data); }, "xml"); Now I can get the title of the podcast by using xml.find("channel > title").text() . How can I select the <itunes:image> tag in my RSS feed? The command xml.find("channel > itunes:image") does not work, because : separates in CSS the tag name and the pseudo class. I also tried xml.find("channel > image") but it does not work. How can I handle XML namespaces in CSS Selectors or in jQuery? CSS allows you to specify namespaces for use with selectors

Facebook Connect and HTML5, xmlns available?

对着背影说爱祢 提交于 2019-12-01 03:08:00
Facebook Connect and their "Social Widgets" documentation mention that you need to add an xmlns attribute to your <html> tag on the page where it will be used. I understand that xmlns is for XML Name-spacing, and have used such with XHTML before. However, with all the recent talk about HTML4 / HTML5, without having read through the entire spec, is the xmlns attribute compatible with valid HTML5? What about HTML4? If I've looked over an obvious mention of this in the docs, I'm sorry... point it out? EDIT: A couple docs references/cites: http://developers.facebook.com/news.php?blog=1&story=198

Namespace Prefixes with IXmlSerializable

非 Y 不嫁゛ 提交于 2019-12-01 01:19:58
问题 Bit confused on the proper decorators to use, or whatever design might be necessary. When serializing a class which is implementing IXmlSerializable is there a way to include the namespace and its prefix in the XmlRoot element? Class definition for example. using System; using System.Xml; using System.Xml.Schema; using System.Xml.Serialization; [XmlRoot("Classy", Namespace = XML_NS)] public class TestClass : IXmlSerializable { private const string XML_PREFIX = ""; // default namespace private

Namespace agnostic XPath query with element content

本秂侑毒 提交于 2019-11-30 21:15:50
The namespace agnostic syntax I've seen around is confusing me. Say I have: <root> <parent attribute="A">A<child>A</child></parent> <parent attribute="B">B<child>B</child></parent> </root> So far I see how: /root/parent/child/text() translates to: /*[local-name()='root']/*[local-name()='parent']/*[local-name()='child']/text() but i'm struggling with things like this: /root/parent[@attribute="A"]/child/text() or: /root/parent[text()="B"]/child/text() or: /root/parent[1]/child/text() How do these translate? Thanks, EDIT: One More :-) <root> <parent> <childName>serverName</childName> <childValue

What is jQuery for Document.createElementNS()?

风流意气都作罢 提交于 2019-11-30 18:16:42
What is jQuery for Document.createElementNS()? function emleGraphicToSvg(aGraphicNode) { var lu = function luf(aPrefix){ switch (aPrefix){ case 'xhtml': return 'http://www.w3.org/1999/xhtml'; case 'math': return 'http://www.w3.org/1998/Math/MathML'; case 'svg': return 'http://www.w3.org/2000/svg'; } return ''; }; var svg = document.evaluate("svg:svg", aGraphicNode, lu, XPathResult.FIRST_ORDERED_NODE_TYPE, null). singleNodeValue; $(svg).children().remove(); rect = document.createElementNS(lu('svg'), "rect"); rect.setAttribute("x", "35"); rect.setAttribute("y", "25"); rect.setAttribute("width",

JAXB - Move dynamically generated namespaces to document root

雨燕双飞 提交于 2019-11-30 17:18:54
问题 I've got this POJO, encapsulating a dynamic, non-nested element of an Atom entry: public class SimpleElement { private Namespace namespace; private String tagName; private String value; private Collection<Attribute> attributes; /* getters/setters/... */ And for completeness, Attribute public class Attribute { private String name; private String value; private Namespace namespace; /* getters/setters/... */ And Namespace : public class Namespace { private final String uri; private final String

XML Namespaces in ASP.NET Web API

点点圈 提交于 2019-11-30 15:19:16
I am currently working on a project that requires me to output XML from its endpoints along with JSON. I have the following model: [DataContract(Namespace="http://www.yale.edu/tp/cas")] [XmlType("serviceResponse")] [XmlRoot(Namespace="http://www.yale.edu/tp/cas")] public class ServiceResponse { [XmlElement("authenticationSuccess")] public AuthenticationSuccess Success { get; set; } [XmlElement("authenticationFailure")] public AuthenticationFailure Failure { get; set; } } The output is as follows when success is not null: <serviceResponse> <authenticationSuccess /> </serviceResponse> Now, I can

Without internet connection, how xmlns attribute can work and understand by browser?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 14:20:55
A simple XHTML document, with the minimum of required tags: and xmlns attribute has a http link. If I am working on localhost and if I don't have an Internet connection, can't I work on XHTML? <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Title of the document</title> </head> <body> The content of the document...... </body> </html> The XML namespace is just there to identify elements based on a namespace, which happens to be in a URI format. See the XML Namespaces spec . In this case, http://www.w3.org/1999/xhtml is the namespace for XHTML; an XML processor will be able to use this