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 (1169)
+ Stylus Studio Technical Forum (14446)
+ Website Feedback (244)
- XSLT Help and Discussion (7593)
-> + Make xstl file working in brow... (4)
-> + identity template, result-docu... (6)
-> - identity template and xsl:resu... (1)
-> + java.lang.RuntimeException: Er... (5)
-> + How to check matching parenthe... (2)
-> - Error only on using xalan:eval... (1)
-> + XSLT not displaying SOAP respo... (2)
-> + How do i delete the node from ... (2)
-> + How to break xslt lines to mak... (4)
-> - Marge node using attribute val... (1)
-> - Replce utf to unicode using xs... (1)
-> - getting different instances of... (1)
-> + XML to Flat (4)
-> + non breaking space   in e... (2)
-> - How can i attach a empty names... (1)
-> + Cannot find a matching 1-argum... (7)
-> - get value from different docum... (1)
-> + How can I change the XML heade... (2)
-> + Stylus Studio and Datapower (9)
-> + Generate XML form a XSD (2)
-> + There is no way to run xslt tr... (3)
-> + XML-Source NS is copied into t... (3)
-> + new guy attempting xslt (2)
-> + XML 2011 question (7)
-> + Manipulating XML with external... (2)
-> + removing duplicates from xml w... (8)
-> + Wnat to use presence of tag t... (2)
-> + modifing Andrew Welch's csv 2 ... (5)
-> + Can't use (or see) XSLT or WYS... (3)
-> + Delete the xsi:nil attribute ... (2)
-> + FOTY0012: Cannot get the typed... (20)
-> + XSLT Mapper - Two way xslt map... (2)
-> + EDI (5)
-> + XSL Test for lack of XML eleme... (4)
-> + Trouble Calling a java functio... (4)
-> + How to generate EDI 997 (2)
-> + followup on tokenize with /r (5)
-> + tokenize a string with \r (4)
-> + How to convert XML to XLS file... (2)
-> - How to convert XML to XLS file... (1)
-> + how to pass value to xsl for t... (3)
-> + entity expansion liimit exceed... (4)
-> + Creating XSLT Stylesheet (2)
-> + Create XSLT from XSD (2)
-> + How to remove nodes from xml b... (4)
-> + Highlighting text in XSL file (4)
-> - XSLT to Excel, predefine cell ... (1)
-> + CSaxon8Driver issue...time out (2)
-> + Is it possible to generate a X... (2)
-> + Is there any tool which genera... (2)
-> + xslt to html producing double ... (2)
-> - ADD 2 XML 2 Generate Single XM... (1)
-> + converting XML1 to XML2 struct... (2)
-> + How to remove the name space i... (2)
-> + Dump Payload into String (4)
-> + Converting Global EDIFACT into... (2)
-> + Auto mapping of XSLT? (3)
-> + Numbering a list broken into m... (3)
-> + help in xsl:analyze-string (2)
-> + Use XSLT with SOAP (2)
-> + Order of Processing Child Elem... (2)
-> + XSL finding a node based on va... (2)
-> + grouping a group? (11)
-> + Query on Looping (5)
-> + java.lang.Assertionerror_: Slo... (7)
-> + CONVERT SQL Server data to XML... (11)
-> + Error using "xsltproc" command... (3)
-> + XML refresh via web broswer (3)
-> + XSL-mapping usage for csv file... (4)
-> + form controls with xslt (2)
-> + Stylus Studio 2011 XML Enterpr... (2)
-> + Looping through Itema and gett... (2)
-> + Image src through System Varia... (3)
-> + XSL-mapping usage for csv file... (3)
-> + How to achieve UTF-8 encoding ... (2)
-> + sorting Using JavaScript (6)
-> + Display values from .xml horiz... (5)
-> + query on xslt for-each (3)
-> + query on xslt for-each (2)
-> + issue for First occurance (2)
-> + XSL: Mapping 2 XSD to 1 XSD (2)
-> + xslt mapper looses linkage fro... (2)
-> - How to Modify only few nodes a... (1)
-> + XSLT autocomplete function (2)
-> + i need to display dynamic list... (2)
-> + How to group when source has m... (11)
-> - Using EXCEL to create XSLT for... (1)
-> + Mapper generating XSLT, popula... (2)
-> + multiple columns (2)
-> + First time to Stylus Studio 20... (3)
-> + xsl:if test statement result t... (4)
-> + XSLT for dynamic target fields (4)
-> + Remove duplicates (2)
-> + XML-XSL grouping issue while d... (2)
-> + Two XML files. Two Tables. One... (3)
-> + Saxon 9.3 with XSLV (2)
-> - How do I remove the text strin... (1)
-> + Xpath of each element (3)
-> + Attributes - required vs optio... (2)
-> + XML schema to XML schema with ... (2)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (1942)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (363)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Sharry StowellSubject: Translate/Contains Prob - Crossword Creation
Author: Sharry Stowell
Date: 15 Mar 2006 09:02 AM
I have a 225 character string as one variable, then do create a 15 x 15 grid, I have split the 225 into 15 different varaibles, 1 for each row.<br>
<br>
Sample 225 string:<br>
RAP-IMPEND-GRADILE-ROADIE etc etc<br>
<br>
I want to convert (from 225 string) the CHARS into 1's and the HYPHENS into 0's:<br>
111011111011111110111111<br>
<br>
1 = White input box later<br>
0 = Black square<br>
<br>
Here's what I have so far: XSL<br>
-----------------------------<br>
<?xml version="1.0" ?><br>
<xsl:stylesheet<br>
xmlns:xsl="<a rel="nofollow" href="http://www.w3.org/1999/XSL/Transform"">">http://www.w3.org/1999/XSL/Transform"</a><br>
xmlns:fo="<a rel="nofollow" href="http://www.w3.org/1999/XSL/Format"">">http://www.w3.org/1999/XSL/Format"</a><br>
version="1.0"><br>
<br>
<xsl:include href="xsqlerror.xsl"/><br>
<xsl:include href="xsqlrequestparameters.xsl"/><br>
<xsl:include href="xsqlstatus.xsl"/><br>
<xsl:variable name="myAlphabet">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><br>
<br>
<xsl:output method="html" media-type="text/html"/> <br>
<br>
<xsl:template match="/"><br>
<html xmlns="<a rel="nofollow" href="http://www.w3.org/1999/xhtml"">">http://www.w3.org/1999/xhtml"</a> xml:lang="en" lang="en"><br>
<head><br>
<title>Crossword lyout</title><br>
<link rel="stylesheet" type="text/css" href="../css/blahblah.css" media="all" /><br>
</head><br>
<body><br>
<table><br>
<tr><td><br>
<xsl:apply-templates select="//crossword" /><br>
</td></tr><br>
</table><br>
<br>
<hr /><br>
<h3>debug info </h3><br>
<xsl:apply-templates select="//xsql-error"/><br>
<xsl:apply-templates select="//request/parameters"/><br>
<xsl:apply-templates select="//xsql-status"/><br>
</body><br>
</html><br>
</xsl:template><br>
<br>
<xsl:template match="crossword/row"><br>
<br>
<!-- USE VALUE OF dbcrosswordSolution AS A VARIABLE--><br>
<xsl:variable name="allAnswer" select="dbcrosssolution/text()"/><br>
<br>
<br>
<!-- CONVERT THE 1ST 15 CHARS TO A ROW A VARIABLE --><br>
<xsl:variable name="allAnswer-Row1" select="substring($allAnswer,1,15)"/><br>
<br>
<!-- CONVERT THE 16 to 30 CHARS TO A ROW A VARIABLE --><br>
<xsl:variable name="allAnswer-Row2" select="substring($allAnswer,16,15)"/><br>
<br>
<!-- CONVERT THE 31 to 45 CHARS TO A ROW A VARIABLE --><br>
<xsl:variable name="allAnswer-Row3" select="substring($allAnswer,31,15)"/><br>
<br>
<!-- CONVERT THE 46 to 60 CHARS TO A ROW A VARIABLE --><br>
<xsl:variable name="allAnswer-Row4" select="substring($allAnswer,46,15)"/><br>
<br>
<!-- CONVERT THE 61 to 75 CHARS TO A ROW A VARIABLE --><br>
<xsl:variable name="allAnswer-Row5" select="substring($allAnswer,61,15)"/><br>
<br>
<!-- CONVERT THE 76 to 90 CHARS TO A ROW A VARIABLE --><br>
<xsl:variable name="allAnswer-Row6" select="substring($allAnswer,76,15)"/><br>
<br>
<!-- CONVERT THE 1ST 91 to 105 CHARS TO A ROW A VARIABLE --><br>
<xsl:variable name="allAnswer-Row7" select="substring($allAnswer,91,15)"/><br>
<br>
<!-- CONVERT THE 106 to 120 CHARS TO A ROW A VARIABLE --><br>
<xsl:variable name="allAnswer-Row8" select="substring($allAnswer,106,15)"/><br>
<br>
<!-- CONVERT THE 121 to 145 CHARS TO A ROW A VARIABLE --><br>
<xsl:variable name="allAnswer-Row9" select="substring($allAnswer,121,15)"/><br>
<br>
<!-- CONVERT THE 136 to 150 CHARS TO A ROW A VARIABLE --><br>
<xsl:variable name="allAnswer-Row10" select="substring($allAnswer,136,15)"/><br>
<br>
<!-- CONVERT THE 151 to 165 CHARS TO A ROW A VARIABLE --><br>
<xsl:variable name="allAnswer-Row11" select="substring($allAnswer,151,15)"/><br>
<br>
<!-- CONVERT THE 166 to 180 CHARS TO A ROW A VARIABLE --><br>
<xsl:variable name="allAnswer-Row12" select="substring($allAnswer,166,15)"/><br>
<br>
<!-- CONVERT THE 181 to 195 CHARS TO A ROW A VARIABLE --><br>
<xsl:variable name="allAnswer-Row13" select="substring($allAnswer,181,15)"/><br>
<br>
<!-- CONVERT THE 196 to 210 CHARS TO A ROW A VARIABLE --><br>
<xsl:variable name="allAnswer-Row14" select="substring($allAnswer,196,15)"/><br>
<br>
<!-- CONVERT THE last 15 CHARS TO A ROW A VARIABLE --><br>
<xsl:variable name="allAnswer-Row15" select="substring($allAnswer,211,15)"/><br>
<br>
<br>
<br>
<br>
<!-- OUTPUT ALL SOLUTION<br>
<xsl:value-of select="$allAnswer-Row1" /><br/><br>
<xsl:value-of select="$allAnswer-Row2" /><br/><br>
<xsl:value-of select="$allAnswer-Row3" /><br/><br>
<xsl:value-of select="$allAnswer-Row4" /><br/><br>
<xsl:value-of select="$allAnswer-Row5" /><br/><br>
<xsl:value-of select="$allAnswer-Row6" /><br/><br>
<xsl:value-of select="$allAnswer-Row7" /><br/><br>
<xsl:value-of select="$allAnswer-Row8" /><br/><br>
<xsl:value-of select="$allAnswer-Row9" /><br/><br>
<xsl:value-of select="$allAnswer-Row10" /><br/><br>
<xsl:value-of select="$allAnswer-Row11" /><br/><br>
<xsl:value-of select="$allAnswer-Row12" /><br/><br>
<xsl:value-of select="$allAnswer-Row13" /><br/><br>
<xsl:value-of select="$allAnswer-Row14" /><br/><br>
<xsl:value-of select="$allAnswer-Row15" /><br/>--><br>
<br>
<xsl:value-of select="dbcrosssolution/text()" /><br>
<br/><br>
<br/> <br>
<br>
<br>
<br>
1, <xsl:value-of select="$allAnswer-Row1" /><br/><br>
<br>
<!-- TRANSLATE ALL VALUE CODE <br>
<xsl:value-of select="translate($allAnswer-Row1, translate($allAnswer-Row1, 'ABCDEF', ''), '')"/> --><br>
2, <xsl:value-of select="translate($allAnswer-Row1, 'ABCDEF', '2')"/> <br>
<br>
<xsl:variable name="A" value="A" /><br>
<xsl:variable name="B" value="B" /><br>
<xsl:variable name="C" value="C" /><br>
<xsl:variable name="D" value="D" /><br>
<xsl:variable name="E" value="E" /><br>
<br/><br>
3, <xsl:if test="contains($allAnswer-Row1, 'A')" ><br>
<xsl:text>A</xsl:text><br>
</xsl:if><br>
<br/><br>
4, <xsl:if test="contains($allAnswer-Row1, 'B')" ><br>
<xsl:text>B</xsl:text><br>
</xsl:if><br>
<br/><br>
5, <xsl:if test="contains($allAnswer-Row1, 'D')" ><br>
<xsl:text>D</xsl:text><br>
</xsl:if><br>
<!--<br>
<xsl:choose><br>
<xsl:when test="contains($allAnswer-Row1, 'A')"><br>
<xsl:variable name="showA" select="translate($allAnswer-Row1, 'A', '1')"/><br>
<xsl:text>A</xsl:text><br>
</xsl:when><br>
<xsl:when test="contains($allAnswer-Row1, 'B')"><br>
<xsl:variable name="showB" select="translate($allAnswer-Row1, 'B', '1')"/><br>
<xsl:text>B</xsl:text><br>
</xsl:when><br>
<xsl:when test="contains($allAnswer-Row1, 'C')"><br>
<xsl:variable name="showC" select="translate($allAnswer-Row1, 'C', '1')"/><br>
<xsl:text>C</xsl:text><br>
</xsl:when><br>
<xsl:when test="contains($allAnswer-Row1, 'D')"><br>
<xsl:variable name="showD" select="translate($allAnswer-Row1, 'D', '1')"/><br>
<xsl:text>D</xsl:text><br>
</xsl:when><br>
<xsl:otherwise> <br>
HHHHHHHHH<br>
</xsl:otherwise><br>
</xsl:choose><br>
<br>
--><br>
<br>
</xsl:template><br>
<br>
</xsl:stylesheet><br>
---------------------<br>
XML<br>
<br>
<?xml version="1.0" encoding="UTF-8" ?> <br>
<crossword-page><br>
<crossword><br>
<row num="1"><br>
<dbcrossid>2006030800</dbcrossid> <br>
<dbcrossname>DEAL!</dbcrossname> <br>
<dbcrossxysize>15</dbcrossxysize> <br>
<dbcrosssolution>RAP-IMPEND-GRADILE-ROADIE-HOLEGINGERSNAP-EWANOVAL-ASA-ATTESTRELIEVE-BRAT------BRIDGETJONESDAHLIA-ONS--EREANEYE-TNT-ICANTSTR--TAE-SNARESHEARTSTRINGS------AREA-SIESTASKERMIT-PHD-IOTAEVER-SKATEBOARDLIDO-ELPASO-DIAPLOD-SMARTY-YAT</dbcrosssolution> <br>
</row><br>
</crossword><br>
</crossword-page><br>
<br>
-----------------------<br>
<br>
<br>
Any help in this matter would be greatly appreciated.<br>
<br>
Thanks<br>
Sharry

Postnext
Sharry StowellSubject: Translate/Contains Prob - Crossword Creation
Author: Sharry Stowell
Date: 15 Mar 2006 09:04 AM
Sorry, not sure why there is so many <BR> tags in my post :(

Postnext
(Deleted User) Subject: Translate/Contains Prob - Crossword Creation
Author: (Deleted User)
Date: 15 Mar 2006 09:06 AM
Hi, Sharry. You might want to try Mulberry Tech's XSLT forum for questions about XSLT usage:

http://www.mulberrytech.com/xsl/xsl-list/index.html

Hope this helps.

David Foster
Stylus Studio Team

Postnext
Sharry StowellSubject: Translate/Contains Prob - Crossword Creation
Author: Sharry Stowell
Date: 17 Mar 2006 08:19 AM
I've signed up here but I don't know where to post.

All I want to know is how to convert:

(String 1#) RAP-IMPEND-GRADILE-ROADIE
into
(String 2#) 111011111011111110111111

Character = 1
Hypens = 0

Thanks

Postnext
Minollo I.Subject: Translate/Contains Prob - Crossword Creation
Author: Minollo I.
Date: 17 Mar 2006 09:17 AM
translate('RAP-IMPEND-GRADILE-ROADIE','ABCDEFGHIJKLMNOPQRSTUVWXYZ-','111111111111111111111111110')

Minollo

Posttop
Sharry StowellSubject: Translate/Contains Prob - Crossword Creation
Author: Sharry Stowell
Date: 17 Mar 2006 09:39 AM
thank you :)

   
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.