xml-namespaces

Using new xmlns.jcp.org namespace on composites causes java.lang.NullPointerException at java.util.concurrent.ConcurrentHashMap.putIfAbsent

只愿长相守 提交于 2019-11-26 16:47:09
问题 I am reading The Java EE 7 Tutorial from http://docs.oracle.com/javaee/7/tutorial/doc/jsf-facelets005.htm#GIQZR After I typed the example code in the chapter 8.5 Composite Components in my IDE and run the example on GlassFish4.0, I got an error java.lang.NullPointerException at java.util.concurrent.ConcurrentHashMap.putIfAbsent(ConcurrentHashMap.java:1078) at com.sun.faces.util.Cache.get(Cache.java:116) at com.sun.faces.application.view.FaceletViewHandlingStrategy.getComponentMetadata

How to remove namespaces from XML using XSLT

。_饼干妹妹 提交于 2019-11-26 16:24:33
问题 I have a 150 MB (it can go even more sometimes) XML file. I need to remove all the namespaces. It's on Visual Basic 6.0, so I'm using DOM to load the XML. Loading is okay, I was skeptical at first, but somehow that part works fine. I am trying the following XSLT, but it removes all the other attributes also. I want to keep all the attributes and elements, I just need to remove the namespaces. Apparently it's because I have xsl:element but not attribute. How can I include the attributes there?

XPath select node with namespace

夙愿已清 提交于 2019-11-26 16:03:23
Its a .vbproj and looks like this <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <ProjectGuid>15a7ee82-9020-4fda-a7fb-85a61664692d</ProjectGuid> all i want to get is the ProjectGuid but it does not work when a namespace is there... Dim xmlDoc As New XmlDocument() Dim filePath As String = Path.Combine(mDirectory, name + "\" + name + ".vbproj") xmlDoc.Load(filePath) Dim value As Object = xmlDoc.SelectNodes("/Project/PropertyGroup/ProjectGuid") what can i do to fix this? Teun D The best way to do things like this (IMHO) is to create a

how to ignore namespaces with XPath

跟風遠走 提交于 2019-11-26 15:47:46
My goal is to extract certain nodes from multiple xml files with multiple namespaces using XPath. Everything works fine as long as i know the namespace URIs. The namespace name itself remains constant, but the Schemas (XSD) are sometimes client-generated i.e. unknown to me. Then i am left with basically three choices : use just one schema for the namespace, hoping nothing goes wrong (can i be sure?) get the children nodes of the document and look for the first node with a namespace URI, hoping its there and just use the URI , hoping its the correct one. can go wrong for multiple reasons

What is an xs:NCName type and when should it be used?

眉间皱痕 提交于 2019-11-26 15:43:49
问题 I ran one of my xml files through a schema generator and everything generated was what was expected, with the exception of one node: <xs:element name="office" type="xs:NCName"/> What exactly is xs:NCName ? And why would one use it, rather xs:string ? 回答1: NCName is non-colonized name e.g. "name". Compared to QName which is qualified name e.g. "ns:name". If your names are not supposed to be qualified by different namespaces, then they are NCNames. xs:string puts no restrictions on your names

What does elementFormDefault do in XSD?

会有一股神秘感。 提交于 2019-11-26 15:11:24
What does elementFormDefault do, and when should it be used? So I found some definitions for elementFormDefault values: qualified - elements and attributes are in the targetNamespace of the schema unqualified - elements and attributes do not have a namespace So from that definition I would think that if a schema is set to qualified then why must you prefix the type with the namespace? And what are the scenarios that you would even have one set to unqualified for that matter? I tried Googling, but all I got were a couple W3C pages that were extremely hard to understand. This is the file I am

Open Graph namespace declaration: HTML with XMLNS or head prefix?

笑着哭i 提交于 2019-11-26 15:01:13
问题 I have seen conflicting information on how to best implement Open Graph namespaces. Specifically, the Open Graph website uses a few different methods, and the Facebook Open Graph examples use other methods. Open Graph website example (using HTML prefix attribute): <html prefix="og: http://ogp.me/ns#"> Open Graph website source code (using HTML XMLNS attribute): <html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#"> Facebook Open Graph documentation (using HEAD prefix

targetNamespace and xmlns without prefix, what is the difference?

落花浮王杯 提交于 2019-11-26 11:48:42
问题 In an xml schema document, if I have both the targetNamespace and the xmlns without a prefix . <xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"http://example.com/\" xmlns=\"http://example.com/\"> What is the exact difference between them? My comprehension is that if you have an xmlns without a prefix, all elements without prefix gets that namespace and...confusingly the same goes for targetNamespace. 回答1: targetNamespace is an XML Schema "artifact"; its purpose:

What are XML namespaces for?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 11:45:33
This is something that I always find a bit hard to explain to others: Why do XML namespaces exist? When should we use them and when should we not? What are the common pitfalls when working with namespaces in XML? Also, how do they relate to XML schemas? Should XSD schemas always be associated with a namespace? They're for allowing multiple markup languages to be combined, without having to worry about conflicts of element and attribute names. For example, look at any bit of XSLT code, and then think what would happen if you didn't use namespaces and were trying to write an XSLT where the

C#, XML, adding new nodes

一曲冷凌霜 提交于 2019-11-26 11:31:53
问题 I am trying to add new nodes to an existing XML file. i have this file with first test elements in it: <?xml version=\"1.0\" encoding=\"utf-8\"?> <Root xmlns=\"http://prpa.org/XMLSchema1.xsd\"> <studenti> <student> <ime>test</ime> <prezime>test</prezime> <ocijena>0</ocijena> </student> </studenti> <profesori> <profesor> <ime>test</ime> <prezime>test</prezime> </profesor> </profesori> </Root> I used this schema to generate this XML document <?xml version=\"1.0\" encoding=\"utf-8\"?> <xs:schema