[19. April 2013] A-400 Advanced Network Setup now available | [11 Jan. 2013] Customize your A-400 Home Screen

Firmware: A-400 [13 May 2013] | C-300 [30 Nov. 2012] | A-300 [30 Nov. 2012] | C-200 [21 Jan. 2013] | A-200/A-210 [10 Aug. 2012]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread: 1 Guest(s)
Post Reply 
Techy XML question
12-28-2011, 01:07 PM (This post was last modified: 12-28-2011 01:27 PM by daniel_owen_uk.)
Post: #1
Techy XML question
I have an excel file with around 40 fields. I need to turn this file into an xml file.

Normally I would try to do this via excel, but unfortunately the xml I need is 3 levels deep and excel wont support that.

It needs to be like;

Quote:(header)Header info
(info1)Bit of stuff
(info2)Bit more stuff
(/info2)
(/info1)
(/header)

Anyone got any software that can do this? Without getting too involved.

(edit- those code tags are about as much use as a chocolate fireguard)

Samsung PS51d8000, Onkyo 509, Tannoy EFX5.1, Xbox 360, Popcornhour C200, Sky+HD, Wii, Harmony one
Find all posts by this user
Add Thank You Quote this message in a reply
12-28-2011, 02:06 PM
Post: #2
RE: Techy XML question
(12-28-2011 01:07 PM)daniel_owen_uk Wrote:  I have an excel file with around 40 fields. I need to turn this file into an xml file.

Normally I would try to do this via excel, but unfortunately the xml I need is 3 levels deep and excel wont support that.

It needs to be like;

Quote:(header)Header info
(info1)Bit of stuff
(info2)Bit more stuff
(/info2)
(/info1)
(/header)

Anyone got any software that can do this? Without getting too involved.

(edit- those code tags are about as much use as a chocolate fireguard)

get a trial version of stylus studio and use their visual mapper to write an xslt that does the xml parsing from the saved-as-xml xcel file.


PCH-A110 ,
C-200, Pioneer PDP-LX5090H , Pioneer SC-LX72 Tongue,
Vifa Premium 22 XT, Peerless XLS-10 Sub
Find all posts by this user
Add Thank You Quote this message in a reply
12-28-2011, 02:15 PM
Post: #3
RE: Techy XML question
I was with you as for as the getting trial bit Smile

So presumably I can feed the excel file into it, map it to the schema I have and then simply output the xml file?

Samsung PS51d8000, Onkyo 509, Tannoy EFX5.1, Xbox 360, Popcornhour C200, Sky+HD, Wii, Harmony one
Find all posts by this user
Add Thank You Quote this message in a reply
12-28-2011, 02:22 PM
Post: #4
RE: Techy XML question
(12-28-2011 02:15 PM)daniel_owen_uk Wrote:  I was with you as for as the getting trial bit Smile

So presumably I can feed the excel file into it, map it to the schema I have and then simply output the xml file?

sort of...
you'll need an xslt to get from one xml to another.
stylus studio can do that but you'll need to do the coding.
however you can use their visual mapper to do this in a drag and drop kinda way.

but as always: ymmv ..
especially if you're not xml /xslt savvy


PCH-A110 ,
C-200, Pioneer PDP-LX5090H , Pioneer SC-LX72 Tongue,
Vifa Premium 22 XT, Peerless XLS-10 Sub
Find all posts by this user
Add Thank You Quote this message in a reply
12-28-2011, 02:29 PM
Post: #5
RE: Techy XML question
I will definitely give it a go over the weekend. Probably a little bit of a sledgehammer to crack a nut if I am honest, and convincing the gaffer to fork out $695 could be pushing it a little.

Samsung PS51d8000, Onkyo 509, Tannoy EFX5.1, Xbox 360, Popcornhour C200, Sky+HD, Wii, Harmony one
Find all posts by this user
Add Thank You Quote this message in a reply
12-29-2011, 12:37 AM (This post was last modified: 12-29-2011 12:46 AM by lordy.)
Post: #6
RE: Techy XML question
Personally, if it's a one off excercise, I'd export to CSV and get a good text editor that supports macros and do it manually.

Also if you have control over the final XML format you may find it could be a PITA getting at your header info and your info1, information (which looks like the 1st text() child).
Especially when dealing with white space. Usually it is a little easier to have each thing in its own element tag (or attribute) eg.

Code:
(info1)(infodata)Bit of stuff(/infodata)
(info2)Bit more stuff(/info2)(/info1)

Oversight: Jukebox | FeedTime: Automatic nzbs
Find all posts by this user
Add Thank You Quote this message in a reply
12-29-2011, 10:24 AM (This post was last modified: 12-29-2011 10:25 AM by daniel_owen_uk.)
Post: #7
RE: Techy XML question
Text editor is a definite no no, like I say 400 lines a week 40 fields.

Code:
(?xml version="1.0" encoding="utf-8"?)
(ABWInvoice xmlns="http://services.agresso.com/schema/ABWInvoice/2007/12/24" xmlns:agrlib="http://services.agresso.com/schema/ABWSchemaLib/2007/12/24" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://services.agresso.com/schema/ABWInvoice/2007/12/24 http://services.agresso.com/schema/ABWInvoice/2007/12/24/ABWInvoice.xsd")
(Invoice)
    (InvoiceNo)8989890(/InvoiceNo)
    (Header)
        (agrlib:InvoiceDate)2011-10-30(/agrlib:InvoiceDate)
        (agrlib:DueDate)2011-11-30(/agrlib:DueDate)
        (OrderRef)49000001(/OrderRef)
        (OrderNo)0(/OrderNo)
        (agrlib:ContractId)(/agrlib:ContractId)
        (Currency)GBP(/Currency)
        (Seller)
            (agrlib:SellerNo)SUP11280(/agrlib:SellerNo)
        (/Seller)
        (Buyer)
            (Accountable)DAN(/Accountable)
        (/Buyer)
        (agrlib:ReferenceCode)
            (agrlib:Code)A3(/agrlib:Code)
            (agrlib:Value)FT(/agrlib:Value)
        (/agrlib:ReferenceCode)
    (/Header)
        (Details)
            (Detail)
            (LineNo)1(/LineNo)
            (LineTotExclTax)68.00(/LineTotExclTax)
            (TaxAmount)0.00(/TaxAmount)
            (LineTotInclTax)68.00(/LineTotInclTax)
            (agrlib:TaxCode)ZR(/agrlib:TaxCode)
            (DetailInfo)
            (/DetailInfo)
            (/Detail)
        (/Details)
    (Summary)
        (TotalExclTax)68.00(/TotalExclTax)
        (TotalTax)0.00(/TotalTax)
        (TotalInclTax)68.00(/TotalInclTax)
    (/Summary)
(/Invoice)
(/ABWInvoice)

That's an example of the output file

The input file is

Code:
General ledger code,National product code,Manufacturer's product code,EClass,Description,Requisition point code,Requisition point name,Requisition type,Username,Local reference,Requisition code,Line,Date dd/mm/yyyy,Sale price,Units of issue,Qty,VAT rate,Net total sales,VAT,Gross total sales,Financial week,Financial period,Financial year,Invoice number
,VMU033,203996 ,VHP,Underpads virgin fluff pulp 4-way sealed,Sensitive,Sensitive,Online Ordering,Sensitive,,59790W,1,01/04/2011,Sensitive,Pack of 50,12,Out of scope,101.88,0,101.88,1,1,2012,50114034
,CFP010,201510 ,CXP,All-in-one pads absorbency band D15 Slip,Sensitive,Sensitive,Online Ordering,Sensitive,,59790W,2,01/04/2011,Sensitive,Pack of 28,2,Out of scope,17.4,0,17.4,1,1,2012,50114034
,CFP159,201398 ,CXP,All-in-one pads absorbency band D17 Slip,Sensitive,Sensitive,Online Ordering,Sensitive,,59790W,3,01/04/2011,Sensitive,Pack of 28,4,Out of scope,40.24,0,40.24,1,1,2012,50114034
,CFP072,791102 ,CXP,Absorbent pull-up pants D14 Medium 100%,Sensitive,Sensitive,Online Ordering,Sensitive,,59790W,4,01/04/2011,Sensitive,Pack of 14,4,Out of scope,26.96,0,26.96,1,1,2012,50114034
,CFP073,791202 ,CXP,Absorbent pull-up pants D14 Form super l,Sensitive,Sensitive,Online Ordering,Sensitive,,59790W,5,01/04/2011,Sensitive,Pack of 14,4,Out of scope,28.72,0,28.72,1,1,2012,50114034
,FTG085,Gl880/s ,FTA,Gloves examination latex powder free non,Sensitive,Sensitive,Online Ordering,Sensitive,,59790W,6,01/04/2011,Sensitive,Box of 100,10,Out of scope,44.3,0,44.3,1,1,2012,50114034
,FTE483,Gn31/m ,FTA,Gloves examination latex powder free non,Sensitive,Sensitive,Online Ordering,Sensitive,,59790W,7,01/04/2011,Sensitive,Box of 100,20,Out of scope,84,0,84,1,1,2012,50114034
,FTG087,Gl880/l ,FTA,Gloves examination latex powder free non,Sensitive,Sensitive,Online Ordering,Sensitive,,59790W,8,01/04/2011,Sensitive,Box of 100,10,Out of scope,44.3,0,44.3,1,1,2012,50114034

Samsung PS51d8000, Onkyo 509, Tannoy EFX5.1, Xbox 360, Popcornhour C200, Sky+HD, Wii, Harmony one
Find all posts by this user
Add Thank You Quote this message in a reply
12-29-2011, 11:12 AM
Post: #8
RE: Techy XML question
(12-29-2011 10:24 AM)daniel_owen_uk Wrote:  Text editor is a definite no no, like I say 400 lines a week 40 fields.

Code:
(?xml version="1.0" encoding="utf-8"?)

That's an example of the output file

The input file is

Code:
General ledger code,National product code,Manufacturer's product code,EClass,Description,Requisition point code,Requisition point name,Requisition type,Username,Local reference,Requisition code,Line,Date dd/mm/yyyy,Sale price,Units of issue,Qty,VAT rate,Net total sales,VAT,Gross total sales,Financial week,Financial period,Financial year,Invoice number
,VMU033,203996 ,VHP,Underpads virgin fluff pulp 4-way sealed,Sensitive,Sensitive,Online Ordering,Sensitive,,59790W,1,01/04/2011,Sensitive,Pack of 50,12,Out of scope,101.88,0,101.88,1,1,2012,50114034

I thought the input file was an excel file?
If so use the save as xml option that will output it as an xml file.
Use that as an starting point to make your xslt on.


PCH-A110 ,
C-200, Pioneer PDP-LX5090H , Pioneer SC-LX72 Tongue,
Vifa Premium 22 XT, Peerless XLS-10 Sub
Find all posts by this user
Add Thank You Quote this message in a reply
12-29-2011, 12:23 PM
Post: #9
RE: Techy XML question
It is but I can't paste an excel file Wink

I would use the excel output as xml but unfortunately that only supports 1 child (you can't have 3 nested tables or something).

Samsung PS51d8000, Onkyo 509, Tannoy EFX5.1, Xbox 360, Popcornhour C200, Sky+HD, Wii, Harmony one
Find all posts by this user
Add Thank You Quote this message in a reply
Post Reply 


[-]
Quick Reply
Message
Type your reply to this message here.



Smilies
:) ;) :cool: :D
:P :rolleyes: :shy: :(
:lightbulb: :angry: :-/ (A)
:heart: :dodgy: :blush: :huh:
:my: :sleepy: :exclamation: :S
[get more]

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  question about the dune hd d1 rdsparla 1 1,175 07-22-2012 02:09 PM
Last Post: chris57
  MakeMKV ripping question, how do I know what the main movie is? ominous 4 2,971 04-27-2012 12:36 AM
Last Post: plm
  PCH-C300 Shipment / General Question djgaurav 6 2,560 01-29-2012 08:35 AM
Last Post: djgaurav
  Battlestar Galactica DVD question stryker412 8 2,568 05-28-2010 10:06 AM
Last Post: Gibbo
  Question about timezones kurt 2 1,254 03-13-2010 08:36 AM
Last Post: kurt
  private torrent sites question BORIStheBLADE 1 1,358 02-13-2010 12:18 AM
Last Post: chris57
  So i popped the question. excal 29 4,629 01-04-2010 03:07 AM
Last Post: mcmillyonaire
  Question for Canadian C-200 owners mithrilG60 1 1,153 12-21-2009 10:23 PM
Last Post: nuke12
  Ripping Blue-Ray disc question BORIStheBLADE 24 4,978 10-20-2009 07:53 AM
Last Post: gjs
  Disney Movie BD question stryker412 6 1,893 10-14-2009 07:41 PM
Last Post: stryker412

Forum Jump: