Prestashop API error: Property Category->link_rewrite is not valid - prestashop

I'm try to modify a category through Prestashop API, but I got error:
Validation error: "Property Category->link_rewrite is not valid"
I'm using Postman to Put my changes, but even if I just copy and past the result of the GET in the body of the PUT call, the result give me this error.
this is what I send in the body of the PUT call:
<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<category>
<id>
<![CDATA[3]]>
</id>
<id_parent xlink:href="http://localhost/prestashop/api/categories/2">
<![CDATA[2]]>
</id_parent>
<active>
<![CDATA[1]]>
</active>
<id_shop_default>
<![CDATA[1]]>
</id_shop_default>
<is_root_category>
<![CDATA[0]]>
</is_root_category>
<position>
<![CDATA[0]]>
</position>
<date_add>
<![CDATA[2021-11-18 16:10:04]]>
</date_add>
<date_upd>
<![CDATA[2021-11-18 16:10:04]]>
</date_upd>
<name>
<language id="1" xlink:href="http://localhost/prestashop/api/languages/1">
<![CDATA[Clothes]]>
</language>
<language id="2" xlink:href="http://localhost/prestashop/api/languages/2">
<![CDATA[Clothes]]>
</language>
</name>
<link_rewrite>
<language id="1" xlink:href="http://localhost/prestashop/api/languages/1">
<![CDATA[clothes]]>
</language>
<language id="2" xlink:href="http://localhost/prestashop/api/languages/2">
<![CDATA[clothes]]>
</language>
</link_rewrite>
<description>
<language id="1" xlink:href="http://localhost/prestashop/api/languages/1">
<![CDATA[<p>Discover our favorites fashionable discoveries, a selection of cool items to integrate in your wardrobe. Compose a unique style with personality which matches your own.</p>]]>
</language>
<language id="2" xlink:href="http://localhost/prestashop/api/languages/2">
<![CDATA[<p>Discover our favorites fashionable discoveries, a selection of cool items to integrate in your wardrobe. Compose a unique style with personality which matches your own.</p>]]>
</language>
</description>
<meta_title>
<language id="1" xlink:href="http://localhost/prestashop/api/languages/1">
<![CDATA[]]>
</language>
<language id="2" xlink:href="http://localhost/prestashop/api/languages/2">
<![CDATA[]]>
</language>
</meta_title>
<meta_description>
<language id="1" xlink:href="http://localhost/prestashop/api/languages/1">
<![CDATA[]]>
</language>
<language id="2" xlink:href="http://localhost/prestashop/api/languages/2">
<![CDATA[]]>
</language>
</meta_description>
<meta_keywords>
<language id="1" xlink:href="http://localhost/prestashop/api/languages/1">
<![CDATA[]]>
</language>
<language id="2" xlink:href="http://localhost/prestashop/api/languages/2">
<![CDATA[]]>
</language>
</meta_keywords>
<associations>
<categories nodeType="category" api="categories">
<category xlink:href="http://localhost/prestashop/api/categories/4">
<id>
<![CDATA[4]]>
</id>
</category>
<category xlink:href="http://localhost/prestashop/api/categories/5">
<id>
<![CDATA[5]]>
</id>
</category>
</categories>
<products nodeType="product" api="products">
<product xlink:href="http://localhost/prestashop/api/products/1">
<id>
<![CDATA[1]]>
</id>
</product>
<product xlink:href="http://localhost/prestashop/api/products/2">
<id>
<![CDATA[2]]>
</id>
</product>
</products>
</associations>
</category>
</prestashop>

Please attach exactly what you are sending in, as this is too little information to answer your question in a meaningful way.
It is possible that what you are submitting is really invalid.
In PrestaShop, the link_rewrite fields must be of type URL.
If you use PHP to generate the value, you can use the Tools::str2url() PrestaShop method.

Related

Assertions on XML response in Karate

How to apply assertions in such kind of a response in XML.
I have tried to convert this in json first by using
* json response = response
But this returns an invalid json when checked via json validator. As I thought converting in JSON and then matching the response will be easier.
** Assertions**
Check if first tag is Resource.
Check type is type1
Check valueTotal is 7
Check /Resource/entry/url value is https://myurl1
Check /Resource/entry/resource/user/identifier/type/coding/code
value is CC
<Resource xmlns="http://myurl">
<type xmlns="" value="type1"/>
<valueTotal xmlns="" value="7"/>
<entry xmlns="">
<url value="https://myurl1"/>
<resource>
<user>
<id value="123"/>
<identifier>
<type>
<coding>
<system value="http://myurl2"/>
<code value="CC"/>
<display value="abcedflk"/>
</coding>
<text value="test"/>
</type>
<system value="http://myurl3"/>
<value value="90204343"/>
</identifier>
<patient>
<reference value="value/new"/>
</patient>
<relationship>
<extension url="http://myurl4">
<valueCodeableConcept>
<coding>
<system value="http://myurl5"/>
<code value="xyz"/>
<display value="value11111"/>
</coding>
<text value="value11111"/>
</valueCodeableConcept>
</extension>
</relationship>
<name>
<family value="ABC"/>
<given value="TEST"/>
<given value="JON"/>
</name>
<gender value="male"/>
<birthDate value="1990-02-17"/>
</user>
</resource>
<search>
<mode value="123zbc"/>
</search>
</entry>
<entry xmlns="">
<url value="https://myurl1"/>
<resource>
<user>
<id value="123"/>
<identifier>
<type>
<coding>
<system value="http://myurl2"/>
<code value="CC"/>
<display value="abcedflk"/>
</coding>
<text value="test"/>
</type>
<system value="http://myurl3"/>
<value value="90204343"/>
</identifier>
<patient>
<reference value="value/new"/>
</patient>
<relationship>
<extension url="http://myurl4">
<valueCodeableConcept>
<coding>
<system value="http://myurl5"/>
<code value="abc"/>
<display value="value22222"/>
</coding>
<text value="value22222"/>
</valueCodeableConcept>
</extension>
</relationship>
<name>
<family value="ABC"/>
<given value="TEST"/>
<given value="JON"/>
</name>
<gender value="male"/>
<birthDate value="1990-02-17"/>
</user>
</resource>
<search>
<mode value="123yyy"/>
</search>
</entry>
</Resource>
Assuming the XML is in the variable response:
# the first 2 lines are un-necessary, as all the
# XPath assertions start with /Resource
* json asJson = response
* match asJson contains { Resource: '#present' }
* match /Resource/type/#value == 'type1'
* match /Resource/valueTotal/#value == '7'
* match /Resource/entry[1]/url/#value == 'https://myurl1'
* match /Resource/entry[1]/resource/user/identifier/type/coding/code/#value == 'CC'
Please brush up on XML and XPath if needed: https://github.com/karatelabs/karate#advanced-xpath

Possible DB.TOXML bug? (UniVerse 11.3.1 on AIX)

Based on my understanding of the XMAP specification relative to DB.TOXML, the following XMAP represents a simple object model containing two child tables with the same parent table.
The command DB.TOXML CUST_ACT.XML XMAP_CustomerActivity.XML produces an XML file containing the records and fields from the parent table and one of the child tables as expected. However, the fields for each record of the other child table are repeated once within the record node. If I switch the child TableMaps, in the parent TABLECLASSMAP, the problem switches to the other child table.
It appears that when more than one (child) TableMap is specified in the parent map, fields from the table in the child map referenced by the first (child) TableMap entry are repeated TableMap times in record nodes of that table. This behavior was noticed during development of a process in a real-world UniVerse database environment with a more involved object model.
In order to confirm, I created simple CUSTOMER / CONTACT, CUSTOMER / ORDER files with a few test records for demonstration purposes. If this is a bug versus an XMAP configuration error on my part, then it appears either the XMAPCreate() API function or the XMAPAppendRec() API function may not correctly support this structure.
XMAP:
?xml version="1.0" encoding="UTF-8"?>
<!-- DOCTYPE U2XMAP SYSTEM "U2XMAP.DTD" -->
<U2XMAP version="1.0" Name="XMAP1" >
<!-- Table/Class map XCLASS_CLASS -->
<TABLECLASSMAP MapName="M1" StartNode="/Customers/Customer" TableName="CUSTOMERTBL">
<ColumnMap Node="CustKey" Column="CKEY"/>
<ColumnMap Node="Name" Column="CNAME" />
<TableMap Node="Orders/Order" MapName="M2" />
<TableMap Node="Contact/Methods" MapName="M3" />
</TABLECLASSMAP>
<TABLECLASSMAP MapName="M2" StartNode="Orders/Order" TableName="ORDERTBL">
<ColumnMap Node="CustKey" Column="C.KEY" />
<ColumnMap Node="OrderKey" Column="#ID" />
<ColumnMap Node="OrderDate" Column="ORDERDATE" />
<ColumnMap Node="ProductId" Column="PRODUCTID" />
</TABLECLASSMAP>
<TABLECLASSMAP MapName="M3" StartNode="Contact/Methods" TableName="CONTACTMETHTBL">
<ColumnMap Node="CustKey" Column="C.KEY" />
<ColumnMap Node="ContactKey" Column="#ID" />
<ColumnMap Node="Type" Column="TYPE" />
<ColumnMap Node="Address" Column="ADDRESS" />
</TABLECLASSMAP>
<RelatedTable>
<MapParentKey TableName="CUSTOMERTBL" Column="CKEY" KeyGenerate="No" />
<MapChildKey TableName="ORDERTBL" Column="CKEY" />
</RelatedTable>
<RelatedTable>
<MapParentKey TableName="CUSTOMERTBL" Column="CKEY" KeyGenerate="No" />
<MapChildKey TableName="CONTACTMETHTBL" Column="CKEY" />
</RelatedTable>
</U2XMAP>
RESULT:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Customers>
<Customer>
<CustKey>1</CustKey>
<Name>MOUSE, MICKEY</Name>
<Orders>
<Order>
<CustKey>1</CustKey>
<OrderKey>10</OrderKey>
<OrderDate>01-04-2022</OrderDate>
<ProductId>555R3232</ProductId>
<CustKey>1</CustKey>
<OrderKey>10</OrderKey>
<OrderDate>01-04-2022</OrderDate>
<ProductId>555R3232</ProductId>
</Order>
<Order>
<CustKey>1</CustKey>
<OrderKey>1</OrderKey>
<OrderDate>12-27-2021</OrderDate>
<ProductId>5323423</ProductId>
<CustKey>1</CustKey>
<OrderKey>1</OrderKey>
<OrderDate>12-27-2021</OrderDate>
<ProductId>5323423</ProductId>
</Order>
<Order>
<CustKey>1</CustKey>
<OrderKey>2</OrderKey>
<OrderDate>12-28-2021</OrderDate>
<ProductId>9299399</ProductId>
<CustKey>1</CustKey>
<OrderKey>2</OrderKey>
<OrderDate>12-28-2021</OrderDate>
<ProductId>9299399</ProductId>
</Order>
<Order>
<CustKey>1</CustKey>
<OrderKey>3</OrderKey>
<OrderDate>12-29-2021</OrderDate>
<ProductId>23492349</ProductId>
<CustKey>1</CustKey>
<OrderKey>3</OrderKey>
<OrderDate>12-29-2021</OrderDate>
<ProductId>23492349</ProductId>
</Order>
</Orders>
<Contact>
<Methods>
<CustKey>1</CustKey>
<ContactKey>1</ContactKey>
<Type>HOMEPH</Type>
<Address>444-555-6666</Address>
</Methods>
<Methods>
<CustKey>1</CustKey>
<ContactKey>2</ContactKey>
<Type>HOMEST</Type>
<Address>580 LIBERTY CIR</Address>
</Methods>
</Contact>
</Customer>
<Customer>
<CustKey>2</CustKey>
<Name>FROG, KERMIT</Name>
<Orders>
<Order>
<CustKey>2</CustKey>
<OrderKey>4</OrderKey>
<OrderDate>12-29-2021</OrderDate>
<ProductId>99338822</ProductId>
<CustKey>2</CustKey>
<OrderKey>4</OrderKey>
<OrderDate>12-29-2021</OrderDate>
<ProductId>99338822</ProductId>
</Order>
<Order>
<CustKey>2</CustKey>
<OrderKey>5</OrderKey>
<OrderDate>12-28-2021</OrderDate>
<ProductId>23874771</ProductId>
<CustKey>2</CustKey>
<OrderKey>5</OrderKey>
<OrderDate>12-28-2021</OrderDate>
<ProductId>23874771</ProductId>
</Order>
</Orders>
<Contact>
<Methods>
<CustKey>2</CustKey>
<ContactKey>3</ContactKey>
<Type>HOMEPH</Type>
<Address>777-888-9999</Address>
</Methods>
<Methods>
<CustKey>2</CustKey>
<ContactKey>4</ContactKey>
<Type>WORKPH</Type>
<Address>909-090-0909</Address>
</Methods>
</Contact>
</Customer>
<Customer>
<CustKey>3</CustKey>
<Name>BIRD, BIG</Name>
<Orders>
<Order>
<CustKey>3</CustKey>
<OrderKey>6</OrderKey>
<OrderDate>12-30-2021</OrderDate>
<ProductId>83776632</ProductId>
<CustKey>3</CustKey>
<OrderKey>6</OrderKey>
<OrderDate>12-30-2021</OrderDate>
<ProductId>83776632</ProductId>
</Order>
<Order>
<CustKey>3</CustKey>
<OrderKey>7</OrderKey>
<OrderDate>12-30-2021</OrderDate>
<ProductId>R29898W9</ProductId>
<CustKey>3</CustKey>
<OrderKey>7</OrderKey>
<OrderDate>12-30-2021</OrderDate>
<ProductId>R29898W9</ProductId>
</Order>
<Order>
<CustKey>3</CustKey>
<OrderKey>8</OrderKey>
<OrderDate>12-31-2021</OrderDate>
<ProductId>23884888</ProductId>
<CustKey>3</CustKey>
<OrderKey>8</OrderKey>
<OrderDate>12-31-2021</OrderDate>
<ProductId>23884888</ProductId>
</Order>
<Order>
<CustKey>3</CustKey>
<OrderKey>9</OrderKey>
<OrderDate>12-29-2021</OrderDate>
<ProductId>29993999</ProductId>
<CustKey>3</CustKey>
<OrderKey>9</OrderKey>
<OrderDate>12-29-2021</OrderDate>
<ProductId>29993999</ProductId>
</Order>
</Orders>
<Contact>
<Methods>
<CustKey>3</CustKey>
<ContactKey>5</ContactKey>
<Type>HOMEPH</Type>
<Address>405-040-5040</Address>
</Methods>
</Contact>
</Customer>
</Customers>
Any ideas? Thanks in advance. UniVerse 11.3.1 on AIX.
I also posted this question here but haven't gotten much exposure. (where you can better see highlighted in red the repeated entries).
Looks like it might be a bug to me. I tested it under Linux with 11.3.2 and I noticed the same behavior. It may be a system limitation, but if that were the case I would expect a failure on the mapping call as it seems to be pretty particular.
I would open a ticket with Rocket. I used the HS.SALES demo data that comes with UniVerse to replicate. I will provide it here for you to use in your report. It will be much easier for support to either confirm the bug or tell you what we are collectively doing wrong if they are already working with the same data.
<?xml version="1.0" encoding="UTF-8"?>
<!-- DOCTYPE U2XMAP SYSTEM "U2XMAP.DTD" -->
<U2XMAP version="1.0" Name="XMAP1" >
<!-- Table/Class map XCLASS_CLASS -->
<TABLECLASSMAP MapName="M1" StartNode="/Customers/Customer" TableName="CUSTOMER">
<ColumnMap Node="CustID" Column="#ID"/>
<ColumnMap Node="FirstName" Column="FNAME"/>
<ColumnMap Node="LastName" Column="LNAME" />
<ColumnMap Node="State" Column="STATE" />
<ColumnMap Node="ProductID" Column="PRODID" />
<TableMap Node="States/State" MapName="M2" />
<TableMap Node="Products/Product" MapName="M3" />
</TABLECLASSMAP>
<TABLECLASSMAP MapName="M2" StartNode="States/State" TableName="STATES">
<ColumnMap Node="StateName" Column="NAME" />
</TABLECLASSMAP>
<TABLECLASSMAP MapName="M3" StartNode="Products/Product" TableName="PRODUCTS">
<ColumnMap Node="Price" Column="LIST" />
<ColumnMap Node="Description" Column="DESCRIPTION" />
</TABLECLASSMAP>
<RelatedTable>
<MapParentKey TableName="CUSTOMER" Column="PRODID" KeyGenerate="No" />
<MapChildKey TableName="PRODUCTS" Column="PRODID" />
</RelatedTable>
<RelatedTable>
<MapParentKey TableName="CUSTOMER" Column="STATE" KeyGenerate="No" />
<MapChildKey TableName="STATES" Column="CODE" />
</RelatedTable>
</U2XMAP>
In the mean time if you are blocked and the mapping isn't overly complex you can probably just add I-Descriptors and TRANS (or XLATE) over to the other file to include it in parent dictionary and thus not require any additional table mapping.
Good Luck,

VXML dtmf grammar with unknown number of digits and specific terminating character

I am new to VXML and trying to construct an inline dtmf grammar that will allow any sequence of digits between 1 and 5 terminated with digit 6 be returned.
So all three of the following sequences should result in a fill:
1123236, 236, 55555555552342346
I've tried implementing the grammar like so:
<grammar mode="dtmf">
<rule>
<item>
<item repeat"0-">1|2|3|4|5<item>6</item>
</item>
</rule>
</grammar>
and also like so:
<grammar mode="dtmf">
<rule>
<item repeat"0-">1|2|3|4|5</item>
<item>6</item>
</rule>
</grammar>
I am out of ideas and would greatly appreciate your help
Here is a grammar you may use:
<grammar mode="dtmf" version="1.0" root="oneToFiveSequence">
<rule id="onetofive">
<one-of>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
</one-of>
</rule>
<rule id="oneToFiveSequence" scope="public" >
<one-of>
<item repeat="0-">
<ruleref uri="#onetofive"/>
</item>
</one-of>
</rule>
</grammar>
To stop recognition with digit "6" set a property in your VXML form:
<property name="termchar" value="6" />
In the form while processing "filled" event you will know that the sequence was terminated with "6" so you may append it to data if it needs be.
An equivalent single rule grammar as requested in comments
<grammar mode="dtmf" version="1.0" root="oneToFiveSequence">
<rule id="oneToFiveSequence" scope="public" >
<one-of>
<item repeat="0-">
<one-of>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
</one-of>
</item>
</one-of>
</rule>
</grammar>
Both variants are tested with Holly Connects Voice Platform
Here is an app you may use for quick testing.
<?xml version="1.0" encoding="utf-8"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<property name="inputmodes" value="dtmf"/>
<form id="welcome">
<field name="option">
<property name="termchar" value="6"/>
<grammar mode="dtmf" version="1.0" root="oneToFiveSequence">
<rule id="oneToFiveSequence" scope="public" >
<one-of>
<item repeat="0-">
<one-of>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
</one-of>
</item>
</one-of>
</rule>
</grammar>
<prompt>Enter digits</prompt>
<filled>
<log> You entered <value expr="option"/></log>
</filled>
</field>
</form>
</vxml>

How to copy one xml data into another after last occurrence of a specific element using xslt

I am having two xml files. I want to copy one xml file data into another file under last occurrence of element. Below are the xml I am having :
---------- xml-1---------------
<?xml version="1.0"?>
<parent>
....
<form id="1" name="world"/>
<source id="1" name="abc1"/>
<source id="2" name="abc2"/>
<source id="3" name="abc3"/>
<file id="1" name="xyz"/>
....
</parent>
----------- xml-2--------------
<?xml version="1.0"?>
<root>
<source id="4" data="anything"/>
<source id="5" data="anything"/>
<source id="6" data="anything"/>
<source id="7" data="anything"/>
</root>
------------------The desired output I want-----------------
<?xml version="1.0"?>
<parent>
....
<source id="1" name="abc1"/>
<source id="2" name="abc2"/>
<source id="3" name="abc3"/>
<source id="4" data="anything"/>
<source id="5" data="anything"/>
<source id="6" data="anything"/>
<source id="7" data="anything"/>
<file id="1" name="xyz"
....
</parent>
============== xslt I am using =============
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="node()|#*" name="identity">
<xsl:copy>
<xsl:apply-templates select="node()|#*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="source">
<xsl:choose>
<xsl:when test="'id=3'">
<xsl:call-template name="identity"/>
<xsl:copy-of select="document('file:///D:/Softwares/JEE eclipse/JEEworkspace/Migration/TestMigrationWithoutDeletingProject/xml2.xml')/*/*"/>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
I am trying to find it out on the basis of id attribute but it is copying xml-2 data after every source element of xml-1 data. Please help me on this.
I think there are two small problems in your code:
The call to <xsl:call-template name="identity"/> should be outside (or rather before) your choose section. By the way: since you not have an otherwise section it would be slightly shorter to use xsl:if here.
The test for the correct insertion point should be test="#id = 3" since the term "'id=3'" is simply a string which always yields true().

Problem with xml select in tsql - can't seem to orgenize multi nodes in the right order

this is my code, i am trying to make a simple 3 nodes select in XML and it is not working, i am getting the parent, the second nodes (all of them) and then the third nodes (all of them) (categories->category(all)->products(all) and not in the right order (categories->category->all products for that category)
select 1 as tag,
null as parent,
null as [Categories!1],
null as [Category!2!ID],
null as [Category!2!Name],
null as [Product!3!ID],
null as [Product!3!Name],
null as [Product!3!Price]
union all
select 2 as tag,
1 as parent,
null,
CategoryID,
CategoryName,
NULL,
NULL,
NULL
from dbo.Categories
union all
select 3 as tag,
2 as parent,
null,
null,
null,
ProductID,
ProductName,
UnitPrice
from dbo.Products
where CategoryID=CategoryID
for xml explicit
If any one has an idea what am i doing wrong it would be great.
Thank you,
Erez
SQL Server 2005 and up have a very powerful new command - FOR XML PATH - which is a lot easier to use than the FOR XML EXPLICIT of olden days.
I don't know what exactly you want, but you could do something like:
SELECT
cat.CategoryID AS '#CategoryID',
cat.CategoryName AS 'Category/Name',
pr.ProductID AS '#ProductID',
pr.ProductName 'Product/Name',
pr.UnitPrice
FROM
dbo.Categories cat
INNER JOIN
dbo.Products pr ON cat.CategoryID = pr.CategoryID
FOR XML PATH('ProductCategory'), ROOT('Root')
This should give you something like:
<Root>
<ProductCategory CategoryID="5" ProductID="66">
<Category>
<Name>YourCategory Nr. 5</Name>
</Category>
<Product>
<Name>Your Product Nr. 66</Name>
</Product>
<UnitPrice>50.50</UnitPrice>
</ProductCategory>
</Root>
See some of those resources for more information on FOR XML PATH:
What's new in FOR XML in Microsoft SQL Server 2005
Using XML Serialization with SQL's FOR XML PATH
FOR XML PATH - a new mode in FOR XML in SQL Server 2005
Marc
UPDATE: ok, now that we know what you really want, I can provide the right answer :-)
SELECT
cat.CategoryID AS '#ID',
cat.CategoryName AS '#Name',
(SELECT
pr.ProductID AS '#ID',
pr.ProductName AS '#Name',
pr.UnitPrice AS '#Price'
FROM
dbo.T_Product pr
WHERE
cat.CategoryID = pr.CategoryID
FOR XML PATH('product'), TYPE
)
FROM
dbo.Categories cat
FOR XML PATH('category'), ROOT('Categories')
That gives me the output (from Northwind):
<Categories>
<category ID="1" Name="Beverages">
<product ID="1" Name="Chai" Price="18.0000" />
<product ID="2" Name="Chang" Price="19.0000" />
<product ID="24" Name="Guaraná Fantástica" Price="4.5000" />
<product ID="34" Name="Sasquatch Ale" Price="14.0000" />
<product ID="35" Name="Steeleye Stout" Price="18.0000" />
<product ID="38" Name="Côte de Blaye" Price="263.5000" />
<product ID="39" Name="Chartreuse verte" Price="18.0000" />
<product ID="43" Name="Ipoh Coffee" Price="46.0000" />
<product ID="67" Name="Laughing Lumberjack Lager" Price="14.0000" />
<product ID="70" Name="Outback Lager" Price="15.0000" />
<product ID="75" Name="Rhönbräu Klosterbier" Price="7.7500" />
<product ID="76" Name="Lakkalikööri" Price="18.0000" />
</category>
<category ID="2" Name="Condiments">
<product ID="3" Name="Aniseed Syrup" Price="10.0000" />
<product ID="4" Name="Chef Anton's Cajun Seasoning" Price="22.0000" />
<product ID="5" Name="Chef Anton's Gumbo Mix" Price="21.3500" />
<product ID="6" Name="Grandma's Boysenberry Spread" Price="25.0000" />
<product ID="8" Name="Northwoods Cranberry Sauce" Price="40.0000" />
<product ID="15" Name="Genen Shouyu" Price="15.5000" />
<product ID="44" Name="Gula Malacca" Price="19.4500" />
10x, but this is not what i am looking for.
In your answer u have 2 nodes. the parent(root) and 1 chile (ProductCategory) all the rest are attributes of the child node, not a new node under the child node.
what i am looking for is this
<Categories>
<category ID="2" Name="chuki">
<product ID="1" Name="chukchuk" Price="20" />
<product ID="2" Name="mhukmhuk" Price="20" />
<product ID="3" Name="ChakChak" Price="20" />
.......
</category>
<category ID="1" Name="Chuki">
<product ID="4" Name="lllll" Price="20" />
<product ID="5" Name="hhhhhh" Price="20" />
<product ID="1" Name="ChukChuk" Price="20" />
........
</category>
........
</categories>