xml-namespaces

How to create XML with XML::Twig containg a namespace declaration and prefixed names?

一笑奈何 提交于 2019-12-06 06:10:38
I am creating a new XML document from scratch using XML::Twig . The root element should have a prefix and a namespace declaration. All children should also belong to this namespace and use this prefix. The output should be something like this: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <abc:root xmlns:abc="http://www.somehost.com/abc-data/ns/5.0.0" version="5.0.0.0"> <abc:element name="myElement"> This is my element </abc:element> </abc:root> I suppose it would look somewhat like this: my $new_twig = XML::Twig->new(map_xmlns => {'http://www.somehost.com/abc-data/ns/5.0.0' => "abc"}

Why do I keep getting 'Assembly must be specified for XAML files that are not part of a project' errors in a local project?

情到浓时终转凉″ 提交于 2019-12-06 03:31:13
To start with, I would like to stress that I do know how to define XML Namespaces correctly in my XAML files. This repeated error is not caused by an mistake in my code. The problem does not stop my project from being built successfully, or running and the mentioned Converter class works perfectly. When I build the project, the errors disappear. However, the designer show the familiar error message: When I click on the 'Reload the designer' link, the errors return. The worst part of this problem is that I lose all Intellisense on these views. The error highlights these namespaces: But you can

Why does the 'xmlns' attribute affect XPath Node lookup?

霸气de小男生 提交于 2019-12-06 03:26:20
问题 The following code works perfect. See XML file below. XPathDocument xPathDoc = new XPathDocument(@"C:\Authors.xml"); XPathNavigator navigator = xPathDoc.CreateNavigator(); XPathNodeIterator iterator = navigator.Select("/Contacts/Author/FirstName"); iterator.MoveNext(); string firstName = iterator.Current.InnerXml; Console.WriteLine(firstName); The value of 'firstName' returns 'Joe' which is perfect. However, when I add this attibute xmlns="http://www.w3.org/1999/xhtml" to the '' tag, so that

XSLT applied to XML doc with xmlns attribute

纵饮孤独 提交于 2019-12-06 02:59:17
问题 I'm applying an XSLT stylesheet to the following XML file: <top xmlns="http://www.foo.com/bar"> <elementA /> <elementB /> <contents> <contentitem> <id>3</id> <moretags1 /> <moretags2 /> </contentitem> <contentitem> <id>2</id> <moretags1 /> <moretags2 /> </contentitem> <contentitem> <id>1</id> <moretags1 /> <moretags2 /> </contentitem> </contents> </top> Here's my current XSLT file (performs a simple sort): <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns

Dom4j selectNodes(arg) don't give list of nodes

邮差的信 提交于 2019-12-06 01:39:46
问题 I am using DOM4j for XML work in java, my xml is like this: <?xml version="1.0" encoding="UTF-8" standalone="no" ?> <abcd name="ab.catalog" xmlns="http://www.xyz.com/pqr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xyz.com/pqr ./abc.xyz.xsd"> <efg> ...... </efg> <efg> ..... </efg> </abcd> then, List<Node>list = document.selectNodes("/abcd/efg"); gets the size of list zero. I feel it's due to namespace specified in the xml. I tried a lot but cn't get

atom feed xmlns attribute messes up AS3's XML-parsing?

余生颓废 提交于 2019-12-06 01:31:49
Wanna see something interesting? var xml:XML = XML(<feed><entry /><entry /><entry /></feed>); trace(xml.entry.length()) // returns 3 Makes sense, right? Now let's add this attribute... var xml:XML = XML(<feed xmlns="http://www.w3.org/2005/Atom"><entry /><entry /><entry /></feed>); trace(xml.entry.length()) // returns 0 Well that can't be right. Let's try it with a different attribute. var xml:XML = XML(<feed test="okay"><entry /><entry /><entry /></feed>); trace(xml.entry.length()) // returns 3 Anyone know what would cause this? I used atom as an example, but any 'xmlns' attribute on the root

What is the use of @namespace in CSS?

情到浓时终转凉″ 提交于 2019-12-05 23:09:32
问题 From the doc, I found the use of namespace like below: @namespace foo url(http://www.example.com); foo|h1 { color: blue } But I want to know more about this. Why do we use it? 回答1: In your given example, the color: blue rule will be limited to only h1 elements in the foo namespace (linked by url(example.com) ). To my knowledge, it's regarded as not often needed. And it certainly looks weird. Here's a nice summary of its application: http://nimbupani.com/spacing-out-on-css-namespaces.html The

JAXB bindings file: namespace-aware node selection

£可爱£侵袭症+ 提交于 2019-12-05 22:50:50
I tend to use external JAXB bindings files for my Schema-to-Java compilation. This works just fine, but I did notice one thing that I've started wondering about. It's not really JAXB-specific, more like an XPath question, but the context helps. Suppose we have this schema: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:test="www.acme.com" targetNamespace="www.acme.com" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="el1"/> <xs:complexType name="testType"> <xs:sequence> <xs:element ref="test:el1"/> </xs

In C#, is there a way to generate an XDocument using the short prefix instead of the full namespace for each node?

孤街浪徒 提交于 2019-12-05 22:20:37
问题 I'm simply trying to make my XML a bit tidier and less bulky. I know in C# one can do something like this: XNamespace ds = "http://schemas.microsoft.com/ado/2007/08/dataservices"; new XElement(ds + "MyDumbElementName", "SomethingStupid"); And get an XML simliar to this: <root> <MyDumbElementName xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices"> SomethingStupid </MyDumbElementName> </root> Instead of something like this: <root xmlns:ds="http://schemas.microsoft.com/ado/2007/08

Changing namespace and schemaLocation attribues in WCF

大憨熊 提交于 2019-12-05 21:50:57
I developed a WCF service in C#. Our customer already has a client software written in Java. They say when they try to add our wcf service referance, they get an error. They think that the problem about namespaces. I don't know much about namespaces or any other tag details in WCF. They say wcf service's wsdl output has to be like the following: <xsd:import id="base" namespace="http://helios.theircompanyName.com/im schemaLocation="http://wwwdev1.theirCompanyName.com:8000/HeliosIM/im?xsd=1"/> But our service gives: <xsd:import schemaLocation="http://myComputerName/MyWcfProjectFolder