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)
-> - Stylus Studio - Registrar en o... (1)
-> + Stylus Studio - Registrar en o... (2)
-> + Can a pipeline send a file by ... (2)
-> + After Updateing WIN10 to WIN11... (12)
-> + Where do I add the custom java... (3)
-> + Where is the Diagram tab? (5)
-> + Applying XSLT to Word DOCX/XML (2)
-> - CSV conversion via ConvertToXM... (1)
-> + Text symbols in SS not same as... (4)
-> + Exposing xquery as webservice ... (6)
-> + Syntax Identifier (2)
-> + Saving a Converted XML as an X... (5)
-> + Output document cannot be pars... (4)
-> - Archiving output from conversi... (1)
-> + EDIFACT guideline from Stylus ... (3)
-> + CSV file putting all the data ... (5)
-> + Can't install Home version 64b... (5)
-> + presale - Can I covers this sc... (5)
-> + Problem with UNB (5)
-> + Splitting EDIFACT files pipeli... (4)
-- [1-20] [21-40] [41-60] Next
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Rick BomarSubject: Adaper question???
Author: Rick Bomar
Date: 26 Apr 2005 09:49 AM
Originally Posted: 26 Apr 2005 09:48 AM
How do I add a Trailer Region which is a count of the total number of records? This row will vary at which line number it could be at each time a new file is created, depending on how many records are in the file. When I created a Trailer Region, it seemed to always end up on the row I created it on when it was created in the adapter. All records after that are messed up. ie- if the region was created on row 100 one time and I created a new file with 150 rows, the Trailer Region would still break on row 100. I need this region to be a floating region and always appear at the end of the file. Is this something I need to do in my Stylesheet?<br> I tried that already but since it is not defined in the adapter, ie- no fields or region, it did not work. If this needs to be done in my xls, what would be the command? Thanks !<br>

Postnext
Ivan PedruzziSubject: Adaper question???
Author: Ivan Pedruzzi
Date: 26 Apr 2005 11:08 AM

Use the following XSLT

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<HC_DATA>
<xsl:for-each select="HC_DATA/HEADER">
<HEADER>
<xsl:copy-of select="TRANS_CODE | RPT_YEAR | RPT_QTR | DATA_TYPE | DATA_TYPE | SUBMISSION_TYPE | SUBMISSION_TYPE | PROC_DATE | AHCA_NUM | ORG_NAME"/>
<CONTACT_PERSON>
<xsl:copy-of select="NAME | PHONE | STREET | CITY | STATE | ZIP | EMAIL"/>
</CONTACT_PERSON>
</HEADER>
</xsl:for-each>
<RECORDS>
<xsl:for-each select="HC_DATA/RECORDS">
<RECORD id="{RECORD_ID}">
<xsl:copy-of select="RECORD_ID/following-sibling::*"/>
</RECORD>
</xsl:for-each>
</RECORDS>
<TRAILER>
<NUMBER_OF_RECORDS>
<xsl:variable name="mask" select="''"/> <!-- if you need padding use for example '0000000' -->
<xsl:variable name="r-count" select="count(HC_DATA/RECORDS)"/>
<xsl:variable name="padding" select="substring($mask, 1, (string-length($mask) - string-length($r-count)) )"/>
<xsl:value-of select= "concat($padding, $r-count)"/>
</NUMBER_OF_RECORDS>
</TRAILER>
</HC_DATA>
</xsl:template>
</xsl:stylesheet>

Posttop
Tony LavinioSubject: Adaper question???
Author: Tony Lavinio
Date: 27 Apr 2005 11:07 AM
If you are using Convert-to-XML, you don't want to use Regions. What you want to do is use the regular-expression matching ability. You need to create a node and pattern that matches only the summary row. For example, if you summary row never contains a comma, you can select on that. If you post a copy of your input XML, we can demonstrate how for you. Or you can mail it to stylus-field-report (at) stylusstudio.com

   
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.