Menu
  • HOME
  • TAGS

Missing XML tag This required tag is missing. Please add it and resubmit

Tag: xml,sitemap

I'm having trouble with the following sitemap:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>http://codingforspeed.com/forum/sitemap.php?fid=1</loc>
    <lastmod>2015-07-06 12:42:18</lastmod>
  </sitemap>
  <sitemap>
    <loc>http://codingforspeed.com/forum/sitemap.php?fid=3</loc>
    <lastmod>2015-07-06 12:42:18</lastmod>
  </sitemap>
  <sitemap>
    <loc>http://codingforspeed.com/forum/sitemap.php?fid=4</loc>
    <lastmod>2015-07-06 12:42:18</lastmod>
  </sitemap>
  <sitemap>
    <loc>http://codingforspeed.com/forum/sitemap.php?fid=5</loc>
    <lastmod>2015-07-06 12:42:18</lastmod>
  </sitemap>
  <sitemap>
    <loc>http://codingforspeed.com/forum/sitemap.php?fid=6</loc>
    <lastmod>2015-07-06 12:42:18</lastmod>
  </sitemap>
  <sitemap>
    <loc>http://codingforspeed.com/forum/sitemap.php?fid=7</loc>
    <lastmod>2015-07-06 12:42:18</lastmod>
  </sitemap>
</sitemapindex>

It is validated perfectly, but when I submit to google web master it complains:

Missing XML tag
This required tag is missing. Please add it and resubmit.

Google Doesn't Like it

Best How To :

You're serving different sitemap content to Googlebot. This is what we (Google) get when we try to fetch your sitemap:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
</sitemapindex>

Try to fetch the sitemap itself with Fetch as Google in Search Console (former Webmaster Tools) or with a tool like Testuri)

enter image description here

odoo v8 - Field(s) `arch` failed against a constraint: Invalid view definition

python,xml,view,odoo,add-on

You have made silly mistake in defining _columns. _colums is not valid dictionary name for fields structure. Replace this by _columns and restart service and update module. ...

XSLT for-each statement not iterating proper amount of times

xml,xslt

Try it this way? <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/template/L"> <html> <body> <ul> <xsl:for-each select="Q"> <li> <xsl:value-of select="text()"/> <ul> <xsl:for-each select="R"> <li> <xsl:value-of select="."/> </li> </xsl:for-each> </ul> </li> </xsl:for-each> </ul> </body> </html> </xsl:template> </xsl:stylesheet> Explanation: When...

HTMLPurifier without XML declaration

php,xml,htmlpurifier

you need cut result string $n = strlen('<?xml encoding="utf-8" ?>'); $content_text_fixHTML = substr($H->purify($content_text), $n); ...

Change attribute value of an XML tag in Qt

c++,xml,qt

I guess, but I think your XML is only present in your memory. You have to trigger somethink like tsFileXml.WriteToFile(filename) to store your changes to a file on your filesystem.

Deserializing or parse XML response in Symfony2

php,xml,symfony2,deserialization,jmsserializerbundle

It depends on your intention. If you want to directly push part or all of the XML to an entity/document object for saving to a database then the JMSSerializerBundle can do this very smartly and is definitely the best way to do it. If however you just want to extract...

XML-XSLT-XPATH : How to convert multiple XML elements to a string, separated by semicolon

xml,xslt,xpath,xslt-2.0

you could use something like: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="text"/> <xsl:template match="/"> <xsl:text>UserNames: &quot;</xsl:text> <xsl:value-of select="/Users/user/username" separator=";"/> <xsl:text>&quot;&#xA;</xsl:text> <xsl:text>Names: &quot;</xsl:text> <xsl:value-of select="/Users/user/name" separator=";"/>...

C# XML: System.InvalidOperationException

c#,xml

Is "User Info" and "Course Data" is a different entity. If it is so, I think you may encapsulate them in one entity. XmlTextWriter writer = new XmlTextWriter(path, System.Text.Encoding.UTF8); writer.WriteStartDocument(true); writer.Formatting = Formatting.Indented; writer.Indentation = 4; writer.WriteStartElement("My Entity"); /* It is a biggest one*/ writer.WriteStartElement("User Info"); writer.WriteStartElement("Name"); writer.WriteString(userName); writer.WriteEndElement(); writer.WriteStartElement("Tutor...

Clean and convert HTML to XML for BaseX

html,xml,converter,xquery,basex

BaseX has integration for TagSoup, which will convert HTML to well-formed XHTML. Most distributions of BaseX already bundle TagSoup, if you installed BaseX from a Linux repository, you might need to add it manually (for example, on Debian and Ubuntu it's called libtagsoup-java). Further details for different installation options are...

Create XSD based on root element

java,xml,parsing,xsd

Using XSL 2.0 you can have multiple output documents and can define every file name, file content, etc. Default java support for XSL 2.0 is far from perfect, so I use the incredible Saxon (you can download saxon-he here, unzip it and add saxon9he.jar to your project). This is the...

XSL - iterate through elements and update based on the node index from another xml file

xml,xslt

An XSL transformation that meets your requirement may be like the following: <?xml version="1.0" encoding="utf-16" ?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml"/> <!-- the update source file: --> <xsl:param name="usource" select="'updatesource.xml'"/> <xsl:template match="Material"> <!-- Material's position: --> <xsl:variable name="pos"> <xsl:value-of select="count(preceding::Material)+1"/> </xsl:variable>...

List view not returning to original state after clearing search

java,android,xml,android-activity,android-listfragment

You are operating on the original data instead of filtered data. You should maintain a reference to original data and use the filtered data for all other purposes. So that the original data is displayed when search is cleared. Replace all usages of mData with mFilteredData as below and only...

Error when building an XDocument

c#,xml,linq,xpath,linq-to-xml

You can ignore pretty much all your code, the issue is just this: XDocument people = new XDocument("Persons"); You can't create an XDocument containing a string, you need to add an element: XDocument people = new XDocument( new XElement("Persons", original.XPathSelectElements(xpathFilterDups))); ...

Convert contents of an XmlNodeList to a new XmlDocument without looping

c#,xml,xpath,xmldocument,xmlnodelist

If you're happy to convert it into LINQ to XML, it's really simple: XDocument original = ...; // However you load the original document // Separated out for clarity - could be inlined, of course string xpath = "//Person[not(PersonID = following::Person/PersonID)]" XDocument people = new XDocument( new XElement("Persons", original.XPathSelectElements(xpath) )...

What is the xpath for retrieving all attribute nodes (whatever be the attributes name) with a specified value?

java,xml,xpath

Well //@* gives you all attribute nodes, add a predicate //@*[. = 'zzz'] and you have all attribute nodes with the value zzz.

How get value from property file to input in springConfig.xml

java,xml,spring-mvc

Look at this line of your stack trace: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mailSender' defined in class path resource [springConfig.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'port'; nested exception is java.lang.NumberFormatException: For input...

Remove all nodes in a specified namespace from XML

c#,xml,linq-to-xml

Iterating through elements then through attributes seems not too hard to read : var xml = @"<?xml version='1.0' encoding='UTF-8'?> <root xmlns:test='urn:my-test-urn'> <Item name='Item one'> <test:AlternativeName>Another name</test:AlternativeName> <Price test:Currency='GBP'>124.00</Price> </Item> </root>"; var doc = XDocument.Parse(xml); XNamespace test = "urn:my-test-urn"; //get all elements in specific namespace and remove doc.Descendants() .Where(o => o.Name.Namespace...

ImageView inside scrollview (Android)

android,xml

use android:fillViewport="true" for scroll view and change ImageView scale type to android:scaleType="fitXY" <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="bottom" > <ScrollView android:id="@+id/scroll" android:fillViewport="true" android:layout_width="fill_parent" android:layout_height="fill_parent"> <RelativeLayout android:id="@+id/relativeLayout1" android:layout_width="match_parent" android:layout_height="match_parent" > <ImageView...

Ruby- get a xml node value

ruby,xml

Try to use css instead of xpath, this will work for you, doc = Nokogiri::XML(response.body) values = doc.css('Name').select{|name| name.text}.join',' puts values => Ram,Sam ...

Unable to construct Document object from xml string

java,xml,xpath,xml-parsing

As Arthur Elrich pointed out in the comments, you should make the factory namespace aware and provide a namespace context to the XPath instance. DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse( new InputSource(new StringReader(...))); XPath xpath = XPathFactory.newInstance().newXPath(); xpath.setNamespaceContext(new MyNamespaceContext()); String s = xpath.evaluate("//location:address/text()",...

R readHTMLTable failed to load external entity [duplicate]

xml,r,connection

In the link that I mentioned in the comment, you can find solutions using RCurl and httr package. Here, I provide the solution using rvest package. library(rvest) kk<-html("http://en.wikipedia.org/wiki/List_of_S%26P_500_companies")%>% html_table(fill=TRUE)%>% .[[1]] //table 1 only head(kk) Ticker symbol Security SEC filings GICS Sector GICS Sub Industry Address of Headquarters 1 MMM 3M...

Java XPath returns single result instead of NodeSet

java,xml,dom,xpath

My guess is that you make a mistake while processing the result NodeList. Try the following approach: NodeList results = (NodeList) xpath.evaluate(..); for (int i = 0; i < nodelist.getLength(); i++) { Node node = (Node) nodelist.item(i); ... } ...

Converting XSD 1.1 to 1.0 - Validation Error

xml,xsd

You can't get this to work with XSD 1.0. An "all" is not allowed as part of a choice. That's actually true in 1.1 as well. But what are you actually trying to achieve? You've got a choice with only one branch, which is obviously redundant, except that it specifies...

Magento simplexml_load_string() error location

php,xml,magento

It's something related with /var/www/html/app/code/core/Mage/Core/Model/Layout/Update.php so I would edit that file and I would go to the line 450. Just before that line write: Mage::log(print_r($filename, true)); Make sure that your logging is enabled and refresh the page. After that, take a look to var/log/system.log. The last xml is probably what...

Parsing XML array using Jquery

javascript,jquery,xml,jquery-mobile

EMI and CustomerName are elements under json so you can use .find() to find those elements and then text() to get its value. $(data).find("json").each(function (i, item) { var heures = $(item).find("CustomerName").text(); var nbr = $(item).find("EMI").text(); console.log(heures); }); .attr() is used to get the attribute value of an element like in...

About sorting based on the counting of subelements

xml,xslt

You can use a key in order to count the properties in the sort instruction. A stylesheet containing the following: <xsl:key name="p" match="property" use="@agency"/> <xsl:template match="/immo"> <result> <xsl:for-each select="agency"> <xsl:sort select="count(key('p', @name))"/> <res id="{ @name }" count="{ count(key('p', @name)) }"/> </xsl:for-each> </result> </xsl:template> when applied to the following input: <immo>...

XML Post from form using curl PHP

php,xml,curl

$data = array( "line1" => "sample data", "line2" => "sample data 2", ); $data_string = json_encode($data); $url = "http://test.com/webservicerequest.asmx"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); // set url to post to curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($data_string))...

XSLT How to remove style from div and td tags

xml,xslt

To remove some nodes start with the identity transformation template <xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template> then add an empty template for the nodes to be removed: <xsl:template xmlns:xhtml="http://www.w3.org/1999/xhtml" match="xhtml:div/@style | xhtml:li/@style | xhtml:td/@style | xhtml:span/@style"/> ...

How to calculate max string-length of a node-set?

xml,xslt,xslt-1.0,libxslt

<xsl:variable name="max_a_width"> <xsl:for-each select="data"> <xsl:sort select="string-length(@a)" data-type="number" /> <xsl:if test="position() = last()"> <xsl:value-of select="string-length(@a)" /> </xsl:if> </xsl:for-each> </xsl:variable> This is the general method of picking from an ordered list of derived values in XSLT 1.0. If you want to pick the minimum/maximum from actual (natively sortable) values, you can take...

finding file in root of wpf application

c#,xml,wpf,visual-studio,relative-path

First, ensure that the file is definitely copied into your output ./bin/ directory on compile: This worked perfectly for me in my WPF application: const string imagePath = @"pack://application:,,,/Test.txt"; StreamResourceInfo imageInfo = Application.GetResourceStream(new Uri(imagePath)); byte[] imageBytes = ReadFully(imageInfo.Stream); If you want to read it as binary (e.g. read an image...

XML, XSL namespaces

xml,xslt,namespaces

To produce a valid output HTML document you just need to add exclude-result-prefixes="xsi xslFormatting" on the <ins:stylesheet> (root) element of your stylesheet. But indeed in your stylesheet you don't use the xsi and xslFormatting namespaces anywhere. Thus you could also modify your stylesheet by removing these namespaces declarations, leading you...

XMLPullParser black diamond question marks with certain characters

android,xml,character-encoding,xmlpullparser,questionmark

Content encoding and character encoding are not the same thing. Content encoding refers to compression such as gzip. Since getContentEncoding() is null, that tells you there's no compression. You should be looking at conn.getContentType(), because the character encoding can usually be found in the content-type response header. conn.getContentType() might return...

Multiply arrays by arrays in JAVA

java,arrays,xml,permutation

Something like this? import java.util.ArrayList; import java.util.Collections; import java.util.List; public class MatrixCross { public static void cross(String[]... matrix){ cross(0,matrix, Collections.EMPTY_LIST); } private static void cross(int index,String[][] matrix, List<String> result){ if (index >= matrix.length){ System.out.println("<test>"); int i = 1; for (String str : result) { System.out.println(" <test_"+i+">"+str+"</test_"+i+">"); i++; } System.out.println("</test>"); }...

XSL transformation outputting multiple times and other confusion

xml,xslt,xpath

1) Your template is applied to 3 elements, and for each of them, loops over all the parents li elements (yes, for each of them, ask all the li elements, children of the grand-father of the current content, which are all the 3 li elements, each time). 2) Because that's...

Extracting XML data from CLOB

sql,xml,oracle

Use xmltable. Data setup: create table myt( col1 clob ); insert into myt values('<ServiceDetails> <FoodItemDetails> <FoodItem FoodItemID="6486" FoodItemName="CARROT" Quantity="2" Comments="" ServingQuantityID="142" ServingQuantityName="SMALL GLASS" FoodItemPrice="50" ItemDishPriceID="5336" CurrencyName="INR" CurrencyId="43"/> </FoodItemDetails> <BillOption> <BillDetails TotalPrice="22222" BillOption="cash"/> </BillOption> <Authoritativeness/> </ServiceDetails>' ); commit; Query:...

XML Schema 1.0 “All” with multiple same elements?

xml,schema

You're blocked by a non-orthogonality of XML Schema. You'd think that the following should work: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="top"> <xs:complexType> <xs:sequence> <xs:all> <xs:element name="A" minOccurs="0"/> <xs:element name="B" minOccurs="0"/> <xs:element name="C" minOccurs="0"/> <xs:element name="D" minOccurs="0"/> </xs:all> <xs:element name="E" minOccurs="1"...

removing a parent node dependig upon child node using xslt

xml,xslt

i want an xslt template which removes the other event node along with child nodes in which other event type value is OriginalCommitDateTime. The standard method to exclude specific nodes is to start with the identity transform template to copy all nodes as the rule, then add an empty...

Sequence number for static and dynamic rows in XSLT 2.0

xml,xslt-2.0

Would this XSLT do: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" /> <xsl:strip-space elements="*"/> <xsl:template match="/*"> <xsl:apply-templates select=".//line"/> </xsl:template> <xsl:template match="line"> <xsl:variable name="pos" select="position() + (3 * count(preceding::data))"/> <xsl:value-of select="concat(format-number($pos, '00000 '), ., '&#xa;')"/> </xsl:template> <xsl:template...

Remove XML Node text using XSLT

xml,xslt,xslt-2.0

Here's one way: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:strip-space elements="*"/> <!-- identity transform --> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="c"> <xsl:apply-templates/> </xsl:template> </xsl:stylesheet> Here's another:...

How to extract efficientely content from an xml with python?

python,xml,python-2.7,pandas,lxml

There are several things wrong here. (Asking questions on selecting a library is against the rules here, so I'm ignoring that part of the question). You need to pass in a file handle, not a file name. That is: y = BeautifulSoup(open(x)) You need to tell BeautifulSoup that it's dealing...

Fixed element in android?

android,xml,android-fragments

You need a FrameLayout. In a FrameLayout, the children are overlapped on top of each other with the last child being at the topmost. activity_main.xml <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:fab="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent"...

group siblings by identifying the first node of a certain type in sequence

xml,xslt,xpath

Try it this way: <xsl:key name="kFirstText" match="*[not(self::type1[not(preceding-sibling::*[1][self::type1])])]" use="generate-id(preceding-sibling::type1[not(preceding-sibling::*[1][self::type1])][1])"/> This excludes the "leader" nodes from the group retrieved by the key....

XElement.Value is stripping XML tags from content

c#,.net,xml,xml-parsing,xelement

As others have said, this format is truly horrible, and will break as soon as the XML embedded in the JSON will contain double quotes (because in the JSON they will be encoded as \", which will make the XML invalid). The JSON should really be embedded as CDATA. Now,...

xpath query seem to be failing

xml,xpath

$str = '<root><Pages> <copyright>me inc. 2015,</copyright> <author>Me</author> <lastUpdate>2/1/1999</lastUpdate> <Home>--------------------</Home> <About>--------------------</About> <Contact>------------------</Contact> </Pages></root>'; $xml = simplexml_load_string($str); $result = $xml->xpath('//Pages/*[(name() = "Home") or following-sibling::Home]'); if ($result === false) { $this->parseError(); //To return xml Error code...

Collect strings after a foreach loop

c#,xml,foreach

Yep, you need to do the adding within the loop. I'd use a List<string> as it supports LINQ: XmlNodeList skillNameNodeList=SkillXML.GetElementsByTagName("name"); List<string> skills = new List<string>(); foreach (XmlNode skillNameNode in skillNameNodeList) { skills.Add(skillNameNode.Attributes["value"].Value); } ...

Tagging values in HTML document for automated extraction

html,xml,html5

If you are using them as meta-documents and they are sent to the parser, then converted as HTML and as long as the converted HTMLs do not have any irrelevant tags, it is fine! So, if the following code: <requirement> THE REQUIREMENT HERE </requirement> Gets converted into something like: <!--...

How to use XDocument to get attributes and add them to a List

c#,xml,winforms,list

The attributes you're trying to get aren't attribute of Payments element. You need to go one level deeper to get them. Try this way : ...... doc = XDocument.Load(reader); var data = doc.Root .Elements() .Elements("Payments"); foreach(var d in data) { var patti = d.Element("Patti"); list1.Add(new List<string>() { patti.Attribute("Rent").Value, patti.Attribute("Water").Value, patti.Attribute("Electricity").Value,...

type conversion performance optimizable?

c#,xml,csv,optimization,type-conversion

IEnumerable<string> values = new List<string>(); values = … Probably not going to be a big deal, but why create a new List<string>() just to throw it away. Replace this with either: IEnumerable<string> values; values = … If you need values defined in a previous scope, or else just: Enumerable<string> values...

Load XML to list using LINQ [duplicate]

c#,xml,linq

Make a base class which will have id,x,y,z, and have Vendors,Bankers and Hospitals extend it. Then you can have a collection of the base class, and add to it the classes that inherit from it....

Get XML node value when previous node value conditions are true (without looping)

xml,vb.net,linq-to-xml

UPDATE Using an XDocument vs an XmlDocument, I believe this does what you're asking without using loops. This is dependent on the elements being in the order of <PhoneType> <PhonePrimaryYN> <PhoneNumber> string xml = "<?xml version=\"1.0\"?>" + "<Root>" + " <PhoneType dataType=\"string\">" + " <Value>CELL</Value>" + " </PhoneType>" + "...

Ninject generic type xml binding

c#,xml,generics,ninject

You want to bind open generic types, so this type definition should do the trick: <bind service="Base.IJsonProvider`1, Base" to="Base.JsonProvider`1, Base" name ="Config"/> ...