XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> - XSL-fo and how to line feed th... (1)
-> + Houston we have a problem (2)
-> + XSL-FO PDF generation (2)
-> + StylusStudio - pick XSLT 1.0 b... (6)
-> - Stylus Studio 2010 debugging f... (1)
-> - Drop down menu List / Option M... (1)
-> - XML transformation using Java ... (1)
-> + i can't to find XSLT editor in... (2)
-> - Copy xml input as value of an ... (1)
-> - Remove Name space from the Tab... (1)
-> - CGI formatted URL with name/va... (1)
-> - Problem with counting (1)
-> + for-each loop is only returnin... (3)
-> - sort date but some dates may b... (1)
-> - Entity Conversion (1)
-> - How can I build an xml convert... (1)
-> + Little Help (2)
-> + how do I merge nodes to one sc... (2)
-> - beginner help xslt and xpath (1)
-> - Convert XML Feed to CSV/SQL/XL... (1)
-> - Working with text node. (1)
-> - No Topic (1)
-> - API for XSLT Converter for .NE... (1)
-> - Getting started (1)
-> + saxon sql extensions - mysql a... (2)
-> - How do I copy and create new e... (1)
-> + substring-before and sums (3)
-> + Parsing special characters in ... (2)
-> + Schema - Require attribute in ... (2)
-> - Edit existing XSL files when n... (1)
-> + How can I use one single XSLT ... (2)
-> - Default selection of value in ... (1)
-> - Problem with watermark in pdf ... (1)
-> + XSLT Parameter Values dialog n... (3)
-> + Value of File Name is not acce... (10)
-> - Need help with a complex table... (1)
-> - How to replace all nordic char... (1)
-> - XSLT java heap space error wit... (1)
-> - Table Overflow to next page (1)
-> - Using XSLT 2.0 to define custo... (1)
-> - "standalone" attribute and xs... (1)
-> + Standardizing IP addresses (2)
-> + Programmatically changing page... (6)
-> + Can Stylus generate XSLT if so... (5)
-> + Extraction based on NODE Name. (2)
-> + NO XSLT:WYSIWYG (2)
-> + determine condition at run tim... (2)
-> - How to reduce top margin in ev... (1)
-> + need help on xsl looping (4)
-> - Convert Symbol to Element (1)
-> + Separator -only- between field... (3)
-> + DocBook (9)
-> + First Occurance of Alphabet (2)
-> + XSL:Key and Document (2)
-> + Excel Macro using XSLT (2)
-> + Add missing element and attrib... (2)
-> + XSL: Stop Count at First Match (2)
-> + XSD to EDI (4)
-> + How to access data from nested... (2)
-> + Simple division of XML file (2)
-> - XML to Flat File (1)
-> + Dispalying data whith xsl:for ... (3)
-> - distinct nodes - into 3 column... (1)
-> + Newbie at XML (2)
-> + XSL Not Working (3)
-> + to draw table using xsl (2)
-> + Base64 decoder (5)
-> + How to create a hidden sheet u... (3)
-> + XML Reports (2)
-> + Copying image files from one d... (2)
-> + XML conversion to RSS (2)
-> + Inserting Image (2)
-> + Xml to Pdf using Xsl (2)
-> + Using a parameter (or similar)... (2)
-> + How to avoid creating empty xm... (2)
-> + how to read txt files in xml (2)
-> + Limit records to 4 per page. P... (4)
-> + XSLT Mapping Based on JDK5 (2)
-> + XML Mappin (2)
-> + Format Datetime with xslt (3)
-> + Cell border missing (2)
-> + XSL: Key (not matches) (5)
-> + Loop through each char in stri... (2)
-> + What is the best way to sum va... (3)
-> + xslt sort help (2)
-> + getting the count (2)
-> + XSL dynamic variables (5)
-> + XSL:Key use (3)
-> + Help With Updating Attributes ... (8)
-> + GETTING COUNT AND POSITION usi... (3)
-> - Hi Everyone !! (1)
-> + Graph Traversal (Keep track of... (2)
-> + XSL IF with sum (2)
-> + Param not incrementing (2)
-> + Iterating through value tags (3)
-> + URGENT :::: Remove the name sp... (2)
-> + Pass new param values to ASP O... (2)
-> + Detect Browser Version in XSL (2)
-> + xslt result-document (2)
-> + Unique nodes based on two attr... (3)
-- Previous [181-200] [201-220] [221-240] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
George PeterSubject: CSV DOC to XML CONVERSION
Author: George Peter
Date: 01 Jul 2009 09:53 AM
Hi I am now testing the trial version and I am trying to convert a .doc file into the standard Medline XML (pubmed). Is it possible to generate the xml automatically? Also, how can I map a csv to the standart pubmed xml?


EXAMPLE
I need to generate something like this:

<ref-list>
<ref id="R1"><label>1</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name><surname>Oosterlinck
</surname><given-names>O</given-names></name><name><surname>van der Meijden</surname><given-names>A</given-names></name></person-group>
<source>Guidelines on TaT1 (Non-muscle invasive) Bladder Cancer. European Association of Urology Guidelines</source><year>2007</year><fpage>1</fpage>
<lpage>17</lpage></nlm-citation></ref> </ref-list>

Postnext
(Deleted User) Subject: CSV DOC to XML CONVERSION
Author: (Deleted User)
Date: 07 Jul 2009 04:59 AM
Hi George,
usually when converting from CSV to XML you use the XML Converter functionality of Stylus Studio, then design an XSLT stylesheet using Mapper to build the desired output structure.
For instance, create a new XSLT stylesheet, go to the Mapper tab, click on the "Add source document" button, select the CSV file in the Open File Dialog, check the "Open with XML Converter" check box and press OK; in the following dialog select the Comma Separated Values entry on the left and press OK.
In Mapper click on the "Set Target Document" button and select either the PubMed schema or an XML instance of such a schema.
Now you are ready to connect the element on the left schema to the ones on the right.

If the CSV data is stored inside a Word document, you will have to extract it to a separate file, e.g. by running another XSLT stylesheet against an XML version of the document

Hope this helps,
Alberto

Postnext
George PeterSubject: CSV DOC to XML CONVERSION
Author: George Peter
Date: 08 Jul 2009 06:36 AM
Hi Alberto

Thank you very munch for your feed back. I did everything you suggested and now I have the desired structure. The question is now how can I actually import the values from the csv over this structure in order to generate the complete xml with values.

Postnext
(Deleted User) Subject: CSV DOC to XML CONVERSION
Author: (Deleted User)
Date: 08 Jul 2009 08:41 AM
Hi George,
could you attach an example of the data, and what you wrote? I don't understand what you mean by "importing the values from csv over this structure".

Alberto

Postnext
George PeterSubject: CSV DOC to XML CONVERSION
Author: George Peter
Date: 10 Jul 2009 06:16 AM
Hi Alberto,
Sorry for not beeing so clear the first time
I need a csv like the one I attached to go into this kind of structure. It doesn't need to be a csv it can be also a flat file (.txt or .doc).



<ref-list>
<ref id="R1"><label>1</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name><surname>Oosterlinck
</surname><given-names>O</given-names></name><name><surname>van der Meijden</surname><given-names>A</given-names></name></person-group>
<source>Guidelines on TaT1 (Non-muscle invasive) Bladder Cancer. European Association of Urology Guidelines</source><year>2007</year><fpage>1</fpage>
<lpage>17</lpage></nlm-citation></ref>
<ref id="R2"><label>2</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name><surname>Loidl</surname><given-names>
W</given-names></name><name><surname>Schmidbauer</surname><given-names>J</given-names></name><name><surname>Susani</surname><given-names>M</given-names>
</name></person-group><article-title>Flexible Cystoscopy assisted by Hexaminolevulinate Induced Fluorescence: A New Approach for Bladder Cancer Detection
and Surveillance?</article-title><source>Eur Urol</source><year>2005</year><volume>47</volume><fpage>323</fpage><lpage>326</lpage></nlm-citation></ref>
<ref-list>


DocumentBook2.csv


Document2.doc
this is how we recieve the references

Postnext
(Deleted User) Subject: CSV DOC to XML CONVERSION
Author: (Deleted User)
Date: 10 Jul 2009 06:50 AM
Hi George,
in the attached picture you can see how I mapped the CSV structure to the XML structure you provided. To run them, just place the other files in the same directory and run the stylesheet.

Hope this helps,
Alberto


Imagemapper(2).JPG
Screenshot of XSLT Mapper

Unknownref-list.xsl
XSLT stylesheet

Unknownref-list.xml
XML structure

UnknownBook2(1).csv
CSV source

Postnext
George PeterSubject: CSV DOC to XML CONVERSION
Author: George Peter
Date: 10 Jul 2009 09:40 AM
Hi Alberto,

Thank you so much. This is almost what i needed. I think my problem was that the csv file was not in the same folder as the xsl and the xml.

Two more questions please:

1. How can we make the tag <ref id="1"> </ref> auto increment for all the iterations?
i.e. <ref id="1"> </ref>
<ref id="2"> </ref> and so on
2. How can we write automatically inside a tag?
i.e <nlm-citation citation-type="journal"> </nlm-citation> - this can be wither journal, either book
<person-group person-group-type="author"> </person-group> - this is unchangeble


Thank you
George

Postnext
(Deleted User) Subject: CSV DOC to XML CONVERSION
Author: (Deleted User)
Date: 10 Jul 2009 09:55 AM
Hi George,
to specify a fixed value for an element, you right click in the target schema node and select Set Text Value.
For the "id" attribute of the "ref" element you should enter {position()} so that the current row number is entered; for "person-group-type" you enter author. For the "citation-type", you will have to come up with some code to decide whether the issue is a journal or a book...

Alberto

Postnext
George PeterSubject: CSV DOC to XML CONVERSION
Author: George Peter
Date: 10 Jul 2009 10:49 AM
Hi Alberto
I took your advice but it does not write inside the begining tag
i.e <ref id="1"> . It writes between the tags i.e: <ref> aaaa</ref>.
Is there something I am missing?

10x
George

Postnext
(Deleted User) Subject: CSV DOC to XML CONVERSION
Author: (Deleted User)
Date: 10 Jul 2009 12:13 PM
Hi George,
you must have invoked the Set Text Value on the "ref" element instead of its "id" attribute.

Alberto

Posttop
George PeterSubject: CSV DOC to XML CONVERSION
Author: George Peter
Date: 13 Jul 2009 08:31 AM
Hi Alberto,
Thank you so much. You were right . I did not have an id attribute. Now it is working perfect. Once again thank you so much for all the help.

Best regards,
George

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.