XSL file formatting

XSL file formatting

Hello.

I have problem with this xsl files, the problem is the output for the date field and the number:
a) `2011-05-13T21:50:00` instead of `13/05/2001 21:50:00`
b) `.00` instead of `0`
It is the output in XML format:
<xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
     <s:Schema id="RowsetSchema">
          <s:ElementType name="row" content="eltOnly" rs:CommandTimeout="30">

               <s:AttributeType name="myDates" rs:number="6" rs:nullable="true" rs:writeunknown="true">
                    <s:datatype dt:type="dateTime" rs:dbtype="timestamp" dt:maxLength="16" rs:scale="0" rs:precision="19" rs:fixedlength="true"/>
               </s:AttributeType>

               <s:AttributeType name="Net" rs:number="29" rs:nullable="true" rs:writeunknown="true">
                    <s:datatype dt:type="number" rs:dbtype="numeric" dt:maxLength="19" rs:scale="2" rs:precision="10" rs:fixedlength="true"/>
               </s:AttributeType>

               <s:extends type="rs:rowbase"/>
          </s:ElementType>
     </s:Schema>
     <rs:data>

          <z:row myDates="2011-05-13T21:50:00" Net=".00" />

     </rs:data>
</xml>
This XML output is generate with the ASP code and saved in csv format:
<!-- #include virtual="/_XML/adovbs.inc" -->

<% 

filename = "titty.xml" 

Set xmlDoc = CreateObject("MSXML2.DOMDocument.4.0")
Set xslDoc = CreateObject("MSXML2.DOMDocument.4.0")

%>

<%

sql = "SELECT * FROM tbl_login" 
Set rs = objConn.Execute(sql) 

rs.Save xmlDoc, 1 

xmlDoc.Save Server.MapPath(filename)

rs.Close 
Set rs = Nothing 

%>

<%

 Set oDOM = CreateObject("MSXML2.DOMDocument.4.0")
 oDOM.async = False 
 
 oDOM.Load Server.Mappath(filename)
  
 Set oXSL = CreateObject("MSXML2.DOMDocument.4.0") 
 oXSL.async = False 
 
 oXSL.Load Server.Mappath("Trasform_csv.xsl")
 
 strTransform = oDOM.transformNode(oXSL) 
 
 Set fso = CreateObject("Scripting.FileSystemObject")
 strPath = Server.Mappath("testme.csv")
  
 Set file = fso.opentextfile(strPath, 2, True)
 file.write strTransform

 file.Close 
 Set file = Nothing
  
 Set fso = Nothing
                        
 Set oDOM = Nothing 
 Set oXML = Nothing 
 Set oXSL = Nothing 
  
%>
The XSL file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" 
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
 xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" 
 xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" 
 xmlns:rs="urn:schemas-microsoft-com:rowset" 
 xmlns:z="#RowsetSchema">
     <xsl:output omit-xml-declaration="yes"/>
     <xsl:template match="/">
          <!-- show a header by looking Schema element -->
          <xsl:for-each select="/xml/s:Schema/s:ElementType/s:AttributeType">
               <xsl:value-of select="@name"/>
               <xsl:choose>
                    <xsl:when test="position()!=last()">
                          <!-- xls -->
                         <xsl:text>     </xsl:text>
                         <!-- csv -->
                         <!--xsl:text>,</xsl:text-->
                    </xsl:when>
                    <xsl:otherwise>
                         <xsl:text>
</xsl:text>
                    </xsl:otherwise>
               </xsl:choose>
          </xsl:for-each>
          <!-- row data -->
          <xsl:for-each select="/xml/rs:data/z:row">
      <xsl:variable name="row" select="."/>
      <!-- for each column -->
               <xsl:for-each select="/xml/s:Schema/s:ElementType/s:AttributeType">
                  <!-- display each column if it exists -->
                 <xsl:variable name="columnName" select="@name"/>
                    <!-- go through all columns and display something that matches-->
                    <xsl:value-of select="$row/@*[name()=$columnName]" />
                    <!--xsl:value-of select="translate($row/@*[name()=$columnName],'.',',')" /-->
                    <xsl:if test="position()!=last()">
                        <!-- xls -->
                         <xsl:text>     </xsl:text>
                         <!-- csv -->
                         <!--xsl:text>,</xsl:text-->
                    </xsl:if>
         </xsl:for-each>
               <xsl:text>
</xsl:text>
       </xsl:for-each>
     </xsl:template>
</xsl:stylesheet>
I need another exit in the XML file:
<z:row myDates="13/05/2001 21:50:00" Net="0.00" />
And the CSV file:
13/05/2001 21:50:00, 0
Can you help me?
Thanks in advance.
See you soon

Published by: user6317803 on August 30, 2011 13:31

Published by: user6317803 on August 30, 2011 13:34

Published by: user6317803 on August 30, 2011 13:36

Hello

What database you use?

I guess you could easily get in shape your columns directly in the SQL query, using something like TO_CHAR (Oracle), CONVERT (SQLServer) or CAST/DATE_FORMAT (MySQL), instead of a plain "SELECT."

Tags: Oracle Development

Similar Questions

  • XSL file to format XML Document

    Hey programmers,.

    This thread is referring to this one (http://supportforums.blackberry.com/t5/Java-Development/Reading-XML-document/m-p/512637) which was resolved yesterday.

    A little history: I ripped with success of XML from a server in response to a post message, I was able to put it inside a document using InputStream and was able to read the text content of this XML on the Blackberry screen.

    Now I would use a .xsl file to format the XML document and then display it on the screen as HTML. Is this possible? How would I go to do this?

    I found this piece of code on the internet (java, not specific to the blackberry associated):

    public class CreationHTML {}
    public static void createHTML (xml, xsl string string, string html) bird Exception {}
    Create the source of DOM
    DocumentBuilderFactory FabriqueD = DocumentBuilderFactory.newInstance ();
    DocumentBuilder builder = fabriqueD.newDocumentBuilder ();
    File fileXml = new File (xml);
    Document document = builder.parse (fileXml);
    Source source = new DOMSource (text);

    Creation of the output file
    File fileHtml = new File (html);
    Result result = new StreamResult (fileHtml);

    Configuration of the transformer
    FabriqueT TransformerFactory = TransformerFactory.newInstance ();
    StreamSource stylesource = new StreamSource (xsl);
    Transformer transformer = fabriqueT.newTransformer (stylesource);
    transformer.setOutputProperty (OutputKeys.METHOD, "html");
            
    Transformation
    transform. Transform (source, result);
    }
    Public Shared Sub main (String [] args) {}
    try {}
    createHTML ("Annuaire.xml", "Annuaire.xsl", "Annuaire.html");
    } catch (Exception e) {e.printStackTrace () ;}
    }
    }

    But actually I have a .xsl, not a string file, do you think that I could adapt it to meet my needs?

    Many thanks for any help!

    If you implement TransformerFactory on blackberry: sure, no problem.

    In the opposite case: rather not.

  • XLIFF file format and use with JAVA API

    Hello

    We use BEEP version 5.6.3 in Oracle Applications 11.5.10.2 and we are developing some reports to be translated into 10 different languages. We are therefore very interested in XLIFF files but have some questions about the file format and the use of the JAVA API

    (A) FILE FORMAT
    Accuracy: we generate the XLF file in menu add-on BEEP in Winword MS used to build the RTF model
    (A - 1), the generated XLF file begins with:
    <? XML version = "1.0" encoding = "utf - 8"? >
    Can we change encoding to "ISO-8859-1' as soon as convert us the file format?

    A-2) section he < header > < skl > < file > internal - contains a huge chain that seeem to be binary... What is c? can delete us it?

    A-3) can you have a file XLF muliple < file > sections (one for each language translation)?
    This can be very useful for us to manage a translation only by a report model file.

    A-4) the most important section for translation is included in the tag < trans-unit >.
    Each of them has a separate as id "49e41f8f" '... '. Can we replace that with a larger significance?

    (A - 5) in the format of language is as "en-US" (area code + language code).
    It is case sensitive?

    (* B) THE USE OF XLIFF FILES WITH JAVA APIS *.
    We use the OPE "FOProcessor" class to generate the PDF providing:
    -Data generated by SQL report XML file
    -File XSL - FO, generated from the module BEEP in MS WINWORD RTF model
    -XLIFF file generated from RTF model by the module BEEP in MS WINWORD
    -The XLIFF file contains a file entry to translate the form English to French
    < file source = target language language "en-US" = "en - US" datatype = "OPE" original = "orphan.xlf" product-version = "orphan.xlf" - name of the product ="" > "

    Here is a summary of our java implementation class:

    Processor FOProcessor = new FOProcessor();
    processor.setData (sXmlDataFilepath);
    processor.setTemplate (sXslTemplateFilepath);
    processor.setOutput (sPdfOutputFilepath);
    processor.setOutputFormat (FOProcessor.FORMAT_PDF);
    processor.setLocale ("en - US");
    xInputXlfLang = new FileInputStream (sXlfLangFilepath);
    processor.setXLIFF (xInputXlfLang);
    try {}
    Processor.Generate ();
    }
    {} catch (XDOException e)
    e.printStackTrace ();
    }


    (variables beginning with "s" are path + names passed as arguments)


    The output PDF file is well generated, but not translated in French!

    (1) I missed something?
    What is wrong in my code or my XLIFF file?
    Y at - it a parameter to pass to allow the XLIFF translation (via setConfig)?
    With "setLocale" we indicate the target language, but how BEEP knows this current language is "en-US"?

    I found a few posts on the subject, but none with a clear solution. So if I managed to solve this problem, I think it can be very useful for many developers.

    Thanks in advance for your help.
    K.Helali

    Edited by: K.Helali Apr 26. 2010 01:56

    Hey,.

    I know what you're talking about.

    Do not make the rtf-> xsl in the office.

    Do it in java code.

    Use RTFprocessor, for her, just set the model and set the true extractxliff.

    move the xsl foprocessor.

    to do this

    (1) in the BEEP for MS Word
    1 - a) build the RTF model
    1-c) extract texts translateable to the XLF file

    (2) in BEEP Server (Linux Redhat, BEEP 5.6.3) included with the Oracle Applications 11.5.102
    (2 - a) write a java class that implements class FOProcessor (see code in my first post)
    I'm passing to the FOProcessor class
    -XML data file
    model model XSL - export RTF, file to the XSL using RTFprocessor file save it sub - (here in rtfprocessor.setextractXlifff - true)
    http://download.Oracle.com/docs/CD/E10415_01/doc/bi.1013/e12693/Oracle/Apps/XDO/template/RTFProcessor.html
    -Translation (via the FOProcessor.setXLIFF method) XLF file

  • Should I change file Format for CD burning

    I'm new with this please bare with me. What I can say all the music I have purchased through iTunes is in the AAC Audio file format. All the music that I imported into iTunes MY Cd collection has been imported with the Apple Lossless Audio File.

    My question is the sound quality of the BEST CD, do I have to convert the music I bought, with is in the ACC Audio, Apple Lossless file format, then burn to the CD? There should just go with the Audio of the right VAC on CD file. I ask this for music that I bought. All the other songs I imported CD into itunes is already Apple Lossless. I am not concerned about the larger files, just to get the best sound quality for CD.

    Hi 80vette,

    Thank you for using communities Support from Apple!

    I see you are eager to learn more about the quality of the music, and if you can do something else to get them to a better quality.  Now it is possible to convert your AAC to Apple Lossless files, the only change you will see is a significant increase of disk space being absorbed by these songs.  Simply put, you can put the lossless format, but you will hear no audio enhancement.  In addition, encoded AAC files downloaded from the iTunes Store already compete with the quality that you hear on a CD of music retail:

    AAC encoded files compete with the quality of the audio CD and sound as good or better than MP3 files encoded in same or even a high sampling rate. For example, a 128 kbps AAC file should sound as good or better than a 160 Kbps MP3 file. Because the flow is weaker, the AAC file is also smaller than the MP3 file.

    12 iTunes for Windows: AAC

    See you soon.

  • When opening .doc website link, FF adds .docx file extention &amp; does not open in Word 2010, with incorrect file format error. Pls Help

    I use Firefox v12 to open a hyperlink to a Web site that points to a door MS Word Document to download.

    Then, we are asked to open the file with MS Word (default), which is our installed version of MS Word 2010.

    Firefox then renames the file by adding a .docx file name for example filename.doc.docx. MS Word 2010 opens with the error "invalid file format", which is correct that Firefox has renamed.

    Is there a fix or a workaround for this?

    You can try to delete the mimeTypes.rdf file in the Firefox profile folder to reset all the actions file.

  • File formats

    Can someone tell me if the 3D data captured via the germs can be exported as wrl, obj, or stl file? If this isn't the case, Sprout files can be imported into 3D Studio Max, manipulated and then exported to print via a 3D printer?

    Thank you

    Hi there @QuasiMaximus

    Welcome to the Forums of HP Support! It's a good place to find the help you need, other users, the HP experts and other members of the support staff. I understand that you are looking for more information on the file formats used by capture 3D on the germ.  I'm happy to help you with this.

    I found this post on the forum where State developers who take in charge for obj, is coming, but not yet included from January 2015.

    3D scanning of objects in 3D - it's files work? -sprout.hp.com

    The same post indicates that the scans themselves are stored in the following location:

    {USER_FOLDER} \AppData\Local\Hewlett-Packard\Sprout\Workspace\AssetRepository\3dCaptures

    However, I also found this video on youtube that shows you how to find the hidden obj files generated by the germ.

    How to access the format file OBJ on the Hp germ - youtube.com

    I hope this is a help to you. If that answered your question, please mark this message as a solution.

  • RAW file format

    No chance, F65/55/5 raw file format is available?

    See you soon.

    You ask for someone to post a clip of RAW file original download?

  • Excel does not recognize this file format

    I've been using excel (Office: mac 2011) for some time. All of a sudden excel opens. I'm getting different error messages such as: "Excel does not recognize this file format" and "There is a problem with the database of the Office". I use OS X EL Capitan 10.11.3 version with my iMac. I tried to uninstall Office: mac & reinstall it with the disk. He re - installs OK but won't open without error message... The rest of the Apps, for example. "Word, Powerpoint open OK. The problem is only with excel. Someone had a similar problem?

    Since your problem is with Excel, you might get a better answer here http://answers.microsoft.com/en-us?auth=1

  • *. SEQ file format has any difference when it is deployed

    A *.seq File Format has any difference when the system is deployed on a tester with the deployment only license?

    I guess that the File Format affects only when you run the sequences in TestStand Development. But I may be wrong, that's why I ask.

    Thank you

    Reference of best practices:

    File format
    File format can affect the speed and performance. Before TestStand 4.0, all sequences have been saved to the INI format.
    TestStand 4.0 and later versions lets you record movies in three formats: INI, XML and binary. Binary format
    offer the faster load and save time and also generates smaller files. You can specify which format to use for new
    dialog box sequence files by clicking on the Options of Format of file button in tab Preferences of Options of Station. TO
    change the format of an existing sequence file, choose the editing command' file of sequence properties and select File Format on the
    General tab.

    The format will not change when it is deployed.  You see it change?  You can test it by opening in a text editor in both cases and see if they look.

    Kind regards

  • SCRIPT CURRENT FOR DIFFERENT FILE FORMATS

    Hi all

    I have a script that takes the .dat as input file. Call DataFileLoad (strDataRawPath_, "DAT", "Load")

    Now, I modified the DAT string to ALL so that it accepts any file format say .iso, .mme, etc...

    But when I try to load the .iso file, it appears a msg that particular file doesn't hit. (I installed the iso plugin)

    How can I make my script accepts multiple file formats?


  • The binary file format

    With the help of LV2010.  I have a program that stores data in a binary file.  The file is a set of strings and floating point values.  I need to write another program in VB.NET that can save/read these files, so I need information on the actual file format of the data.  Is there a documentation which describes how the file is saved?  Thank you.

    Interesting. Usually, this question gets asked in the opposite direction with people trying to decode in a cluster.

    If you use the WriteToBinary function, your data are written as native data types in order to cluster in the binary file. Because you use a cluster, each string is being preceded by a length, which I believe is an I32.

    This is described in the help file for writing to a binary file. I think the people of thing travel length of string/array much however.

  • Faced with the conversion of an U8 2D array data in a Matlab file format?

    I'm trying to convert a simple 2D array of U8 (3 channels) data in a matlab file format.  I was manipulate the examples in the labview2matlabni record - but I can't read in Matlab - the matrix is not readable - said inconsistent number of columns.

    I have included my vi with a sample data as input.  I'm sure this shouldn't be so hard!

    Thanks in advance - all help is appreciated!

    If you have not already, doen

    You can check this site, http://matio-labview.sourceforge.net/. In my view, there are screws to back up or to import files dull.

    See you soon,.

    McDuff

  • various input file formats to diadem

    Hello

    Am new to this area of DIAdem. I read that DIAdem takes input .dat, .mme, .xls and .iso.

    Can someone make me understand that, so that these different input files are used and how they differ from each other? What type of file is more efficient to use?

    Hi Rash.patel,

    They CAME to files, so if you have this file type on your hard drive, you can load it into DIAdem.  If you have a choice of file formats, NOR recommend TDM/TDX or PDM.  List you provided, the former DIAdem *.dat file format is preferable, because it's the only one in the list of stores as a block of data in binary files, which makes it much faster to read and write.

    What type of data files you load into DIAdem to analyze and report?

    Brad Turpin

    Tiara Product Support Engineer
    National Instruments

  • TDMS open - file format version

    Fortunately it is a simple question... What is the difference between the version of the file format 1.0 and 2.0 in the PDM open vi and how will this affect my TDMS file?

    Hi, this link can answer your questions:

    http://zone.NI.com/DevZone/CDA/tut/p/ID/9995

  • What file format to choose to write digital data to the file? 'Text' or 'xlsx '.

    Hello

    I have a request I want to acquire analog input data with NI USB DAQ 6352; to 50 ksamples/second sampling rate, with 8 channels of analog input NI USB DAQ 6352 and I need to display these data on a chart and at the same time I have to back up this data in a file for future recording and analysis.

    My questions are: 1. what file format would be more effective and more appropriate for this application? text or xlsx.

    2. which preferred delivery system to choose?  the category of execution.

    3. what priority should be set? normal or time critical.

    Concerning

    Jamal_IE wrote: I could not find this 'Input voltage - continuous' example in examples of LabVIEW. Could you pls see the path or just download this example VI?

    You do not have installed for your version of LabVIEW DAQmx or you do not have a good search.  It's right there for me.

Maybe you are looking for