15,901,205 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by MKM_Matt (Top 15 by date)
MKM_Matt
4-Apr-19 8:07am
View
Thanks Richard, yes you don't know the API I am putting it against, but appreciate the comment about the line looking suspicious, have changed so same as yours. I will go back to the providers and check the tags with them, (am thinking incorrect name now), but they are ridiculously slow at replying. Thanks again.
MKM_Matt
16-Apr-18 3:56am
View
Hi RickZeeland. Many thanks. I am hoping to have the final solution in XML transform (.xsl) rather than code, i.e. my system will call the transform and load the resulting XML then deal with it. Is there a way to do this? Although will bear your solution in mind if I have to go down the route of doing it all in the code, i.e. read the XML and build the new XML from that.
MKM_Matt
28-Feb-17 3:18am
View
Apologies for the double post, I was looking to ask a question, so put the request out for assistance, a few minutes later went to look for my question, but couldn't find it, so put it out again. I posted the first in the forum by mistake. Apologies again, assistance would be gratefully received.
MKM_Matt
19-Jul-16 11:34am
View
You star Richard. Works as required.
MKM_Matt
25-May-16 4:20am
View
You star. Really appreciate the help and patience... Will try to improve my XML skills!! Thanks again. Matt
MKM_Matt
24-May-16 5:42am
View
Hi. The desired output from the example is:-
<process>1</process>
<order number="1">
<ordercategory>D
<orderlines>
<line what="1" pos="1" />
<line what="1" pos="2" />
<line what="1" pos="3" />
<line what="1" pos="4" />
<line what="1" pos="5" />
<line what="1" pos="6" />
<line what="1" pos="7" />
<line what="1" pos="8" />
<line what="1" pos="9" />
<line what="1" pos="10" />
<line what="1" pos="11" />
<line what="1" pos="12" />
<line what="1" pos="13" />
<line what="1" pos="14" />
<line what="1" pos="15" />
<line what="3" pos="1" />
<line what="3" pos="2" />
<line what="3" pos="3" />
<line what="3" pos="4" />
<line what="3" pos="5" />
<line what="3" pos="6" />
MKM_Matt
24-May-16 5:06am
View
Hah, did it. I got a question on... named it XML Grouping secondary query.
Really appreciate you looking into this for me. Matt
MKM_Matt
24-May-16 4:51am
View
Yes, they sit there with there puffed out cheeks taunting me, saying go on I can eat more than you can type...
MKM_Matt
24-May-16 4:45am
View
Deleted
XSL is
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output encoding="iso-8859-1">
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes">
<!-- group -->
<xsl:key name="level0" match="//product" use="@ordercat">
<xsl:template match="/">
<xsl:attribute name="type">K8 order creation control file
<process><xsl:value-of select="count(/order/productgroup/supplier/product[count(. | key('level0', @ordercat)[1]) = 1])"></process>
<xsl:for-each select="/order/productgroup/supplier/product[count(. | key('level0', @ordercat)[1]) = 1]">
<order>
<xsl:attribute name="number"><xsl:number format="1" value="position()">
<xsl:variable name="onrOrdCat" select="@ordercat">
<ordercategory><xsl:value-of select="$onrOrdCat">
<orderlines>
<xsl:apply-templates select="../product[@ordercat = $onrOrdCat]">
<xsl:template match="product">
<line>
<xsl:attribute name="what"><xsl:value-of select="@what">
<xsl:attribute name="pos"><xsl:value-of select="@pos">
</line>
MKM_Matt
24-May-16 4:43am
View
Have looked on web site and can't see my new posted questions.... Will try to patch it all on to this one again... Matt
MKM_Matt
23-May-16 11:24am
View
Hi.
Pesky hamsters.
Have just logged a call:- Mapping and Grouping secondary. and also XML to XML Grouping and Selecting as the site didn't refresh...
As always thanks in advance.
Matt
MKM_Matt
23-May-16 11:09am
View
Will do.
Thanks again.
Matt
MKM_Matt
23-May-16 10:34am
View
Hi George.
Just done a bit more testing and have noticed an issue.
XML:-
<order display="2204">
<productgroup display="Kitchen Units" lookup="1">
<supplier display="Chippendale" lookup="90">
<product display="Base End Support Panel Natural Oak" what="1" pos="1" ordercat="D" />
<product display="600MM Highline Integrated Dishwasher Fascia" what="1" pos="2" ordercat="D" />
<product display="600MM Highline Base Unit" what="1" pos="3" ordercat="D" />
<product display="600MM Highline Integrated Fridge/Freeezer Fascia" what="1" pos="4" ordercat="D" />
<product display="600MM 3 Drawer Pan Unit" what="1" pos="5" ordercat="D" />
<product display="600MM Highline Base Unit" what="1" pos="6" ordercat="D" />
<product display="500MM Highline Base Unit" what="1" pos="7" ordercat="D" />
<product display="600MM Fridge/Freezer Housing Unit - Type 6" what="1" pos="8" ordercat="D" />
<product display="600MM Double Oven Housing Unit - Type 2" what="1" pos="9" ordercat="D" />
<product display="2650 Plinth Natural Oak Inc Seal Strip" what="1" pos="10" ordercat="D" />
<product display="Worktop 600 Single P/F 4000 Black Brazil" what="1" pos="11" ordercat="D" />
<product display="30MM Bullnose Sq Cornice 3600MM Natural" what="1" pos="12" ordercat="D" />
<product display="10Mtr Roll Edging Tape Natural Oak" what="1" pos="13" ordercat="D" />
<product display="Schock Stnd Inset 1.5 Bowl Drainer Sink" what="1" pos="14" ordercat="D" />
<product display="Schock Universal Plumbing Kit 1.5 Bowl" what="1" pos="15" ordercat="D" />
</productgroup>
<productgroup display="Appliances" lookup="3">
<supplier display="N/A*******N/A" lookup="130">
<product display="CDA - Integrated Combination Fridge/freezer 70/30 A+ Rated" what="3" pos="1" ordercat="D" />
<product display="CDA - Integrated Washing Machine" what="3" pos="2" ordercat="D" />
<product display="CDA - Double Oven Bi Aa Rated Main Oven Touch Control Clock S/steel" what="3" pos="3" ordercat="D" />
<product display="CDA - Five Burner Front Control 70cm Gas Hob Wok Ffd Stainless Steel" what="3" pos="4" ordercat="D" />
<product display="CDA - 70cm Chimney Extractor Hood - Stainless Steel" what="3" pos="5" ordercat="D" />
<product display="CDA - Fully Integrated Dishwasher 60 Cm A++Aa Rated" what="3" pos="6" ordercat="D" />
</productgroup>
XSL:-
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output encoding="iso-8859-1">
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes">
<!-- group -->
<xsl:key name="level0" match="//product" use="@ordercat">
<xsl:template match="/">
<xsl:attribute name="type">K8 order creation control file
<process><xsl:value-of select="count(/order/productgroup/supplier/product[count(. | key('level0', @ordercat)[1]) = 1])"></process>
<xsl:for-each select="/order/productgroup/supplier/product[count(. | key('level0', @ordercat)[1]) = 1]">
<order>
<xsl:attribute name="number"><xsl:number format="1" value="position()">
<xsl:variable name="onrOrdCat" select="@ordercat">
<ordercategory><xsl:value-of select="$onrOrdCat">
<orderlines>
<xsl:apply-templates select="../product[@ordercat = $onrOrdCat]">
<xsl:template match="product">
<line>
<xsl:attribute name="what"><xsl:value-of select="@what">
<xsl:attribute name="pos"><xsl:value-of select="@pos">
</line>
OUTPUT is:-
<
MKM_Matt
17-May-16 12:07pm
View
Hi George. That worked a treat, need to do more testing but all looks brilliant at the moment. You deserve a beer....
MKM_Matt
17-May-16 6:05am
View
Hi George, thanks for the reply.
Not forced into a particular format at moment, just need to ensure that the grouping is correct. So yes I could make them attributes, but I still can't get the grouping part working.
Matt
Show More