Xsl Transformation, XML - saving data



Hi.

I am trying to build simple web application in ASP.NET.
I have xml file with data and xsl file to transform xml file into html doc which will be presented in the browser window and everything is working fine.
What funcionallity do I want?
I want user to enter some text into textboxes and I want this data to be saved into source xml file by clicking for example Save button - I think that it is reversion of transformation process (from html into xml). Can I do something like that? Is it hard to achieve?

regards


Related to : Xsl Transformation, XML - saving data
Transformation Using XML, XSL and PHP Query
ASP & ASP.net
Hi Guys i got a problem with a transformation im trying to do. Im learning about using php to output a xml file using a xsl stylesheet. The code i believe is fine however when i view it in the web browser on the server nothing is displayed or outputted. I've included all the relvent code. Hope someone can help.
Syntax: [ Download ] [ Hide ]Syntax: [ Download ] [ Show ]xslt.class.php file
Syntax: [ Download ] [ Hide ]SXBB[id].writeCmd();Syntax: [ Download ] [ Show ]<?php
       
       
        class xslt
        {
        &
XML Transformation using XSL !! $ !!
ASP & ASP.net

Dear members

I am new to the world of XML and XSL transformation, i hope someone can help me with this XSL transformation
for an XML. I am not geting the expected result as described below

The following is the XML that I am trying to transform to another XML format using the XSL file also describe below
canceljob.xml

<?xml version = "1.0"?>
<?xml-stylesheet type="text/xsl" href="canceljob.xsl"?>
<MSG_CGI_CANCELJOB ID = "WMIS-965931" SRC_SYSTEM_CODE = "WMIS" SRC_SYSTEM_INSTANCE = "WMIS">
<CANCELJOB:CMP_CGI_CANCELJOB xmlns:CANCELJOB = "CANCELJOB" >
<CANCELJOB:ACTIONCODE>1</CANCELJOB:ACTIONCODE>

Xsl Transformation, XML - saving data
ASP & ASP.net

Hi.

I am trying to build simple web application in ASP.NET.
I have xml file with data and xsl file to transform xml file into html doc which will be presented in the browser window and everything is working fine.
What funcionallity do I want?
I want user to enter some text into textboxes and I want this data to be saved into source xml file by clicking for example Save button - I think that it is reversion of transformation process (from html into xml). Can I do something like that? Is it hard to achieve?

regards


XML Transformation with XSL error - please really need answer
ASP & ASP.net

I've tried transforming my XML to HTML

It already says transformation completed, but the new document generated says

Ln 6 Col 6 - The element type "link" must be terminated by the matching end-tag "". 1 Error

I've tried adding closing tag, then it just keeps showing another error...

Here's the code

XML:

<?xml version="1.0" encoding="UTF-8"?>
<!--<?xml-stylesheet type="text/xsl" href="announcement.xsl"
?>-->

<announcement>

    <content>
        <a_num>Announcement</a_num>
        <a_date>Friday, November 7th 2014</a_date>
        <a_subject>Announcement Page</a_subject>
        <a_details>
            We are pleased to announce of Harbour Tennis CupTournament
is open to all members of Harbour Island Tennis Club and preliminary
rounds will need to be played in the weeks leading up to Finals Day on
Saturday 21st November.

            Players can enter more than one age group, ie their own
and one age group above. We have added an additional Girls Hardball
group for ages 12 through 18, but feel free to enter mixed groups too.
Entry is RM20 per event and all juniors are encouraged to enter.

            Consolation rounds will be played for those knocked out in
the first round so everyone is guaranteed at least 2 matches.

            Finals Day is a great day of tennis with senior and junior
matches being played. There will be a BBQ and the bar will be open so
make a note in your diary and come along with family and friends.

            The deadline for entries is 10th May.

            Any questions, please feel free to contact me.

            Many thanks,
            Ahmad Naqib
        </a_details>
    </content>

    <content>
        <a_num>Announcement 2</a_num>
        <a_date>October 1st, 2014</a_date>
        <a_subject>Court Maintenance</a_subject>
        <a_details>
            Hi Harbour Tennis Players!

            We are pleased to announce that our maintenance work is
complete and all tennis facilities are now available to our section
members.
            On that subject, we would like to remind all tennis
members of the importance of having tennis section membership and
having proper tennis cards in order to use the facilities. As a
section we are both partially and fully funding the replacement and
maintenance of the infrastructure (i.e. courts) and tennis equipment
(nets, lights etc). For this reason non-section members are not
allowed to use the tennis courts or receive tennis coaching. For
further information, please contact Reza at 018 337-5754 or
reza@harbourtennis.com

        </a_details>
    </content>

    <content>
        <a_num>Announcement 3</a_num>
        <a_date>October 17th, 2014</a_date>
        <a_subject>How to reserve court</a_subject>
        <a_details>
            1. Mon-Thurs (4-10pm) - courts are booked via a booking
sheet at our tennis court. You can also phone or email our reception
to reserve a court. Each afternoon the booking sheet is posted on the
tennis notice board, for members to refer to.

            2. Fri – Sun – courts are booked via “walk-in”
booking. In order to make a “Walk-in” booking you have to have a
tennis section membership card. You make a walk-in booking using the
green board on the wall near to the tennis shop. To make one of these
bookings a valid booking requires members to fully understand the
rules. Common rules to be reminded of are: 
                        • you can only make a booking 30mins
beforehand
                        • only one member of the same family can
book one court during each hour time-slot
                        • members of the same family cannot book a
court for 2 consecutive hours
            It should be noted, however, that if you turn up (or you
are already playing) and no one has booked the court you want to use
(either by phone booking or Walk-In) or it is 5mins after the hour and
the court is empty then any member can claim that court as their own
until the hour time slot is finished. 
        </a_details>
    </content>

    <content>
        <a_num>Announcement 4</a_num>
        <a_date>November 3rd, 2014</a_date>
        <a_subject>How to reserve court</a_subject>
        <a_details>
        Our popular summer holiday tennis camps will be held on the
following dates:

        11th - 15th November
        18th - 23rd November
        26th -29th November
        Morning session 9 a.m. to 12 noon
        Afternoon session 1 p.m. to 4 p.m.

        Lunch will be 12 noon to 1 p.m.

        Members : RM50 per session 
        Non Members : RM65 per session 
        </a_details>
    </content>

</announcement>

XSL:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
  <html>
<head>
    <title>Announcement</title>
    <link href="style.css" type="text/css" rel="stylesheet"/>
</head>
<body
style="font-family:Arial;font-size:12pt;background-color:#EEEEEE">
    <div id="wrapper">
        <header>
          <div id="header-left">
              <img src="images/logo-test.png"/>
          </div>
        </header>
        <div class="menu">
            <ul>
                <li class="borderradiusleft">
                    <a href="index.html">Home</a>
                </li>
                <li><a href="#">Information</a>
                    <ul class="sub-menu">
                        <li><a href="history.html">About
&amp; History</a></li>
                        <li><a href="rules.html">Tennis
Rules</a></li>
                        <li><a
href="equipments.html">Equipments</a></li>
                        <li><a
href="techniques.html">Techniques</a></li>
                        <li><a
href="benefits.html">Benefits</a></li>
                        <li><a href="newsevents.html">News
&amp; Events</a></li>
                        <li><a
href="tennisclub.html">Tennis Club</a>
                        <ul>
                            <li><a
href="newsevents.html">Organization Chart</a></li>
                            <li><a
href="membership.html">Membership</a></li>
                        </ul>
                        </li>
                        <li><a
href="announcement.xml">Announcement</a></li>
                    </ul>
                </li>
                <li><a
href="shop.html">Shop</a></li>
                <li><a
href="gallery.html">Gallery</a></li>
                <li class="borderradiusright"><a
href="contact_us.html">Contact Us</a></li>
            </ul>
        </div>
        <div id="content-wrapper">
            <xsl:for-each select="announcement/content">
                  <div
style="background-color:teal;color:white;padding:4px;margin:2px;">
                    <span
style="font-weight:bold"><xsl:value-of select="a_num"/> -
</span>
                    <xsl:value-of select="a_date"/>
                  </div>
                  <div style="margin:20px
0px;font-weight:bold"><xsl:value-of
select="a_subject"/></div>
                  <div
style="margin-left:20px;margin-bottom:1em;font-size:10pt">
                    <p>
                    <xsl:value-of select="a_details"/>
                    </p>
                  </div>
            </xsl:for-each>
        </div>
        <footer>
            <div id="footer-left">
                <div class="block">
                    <ul>
                        <li><a
href="index.html">Home</a></li>    
                        <li><a
href="history.html">About</a></li>
                        <li><a
href="gallery.html">Gallery</a></li>
                        <li><a href="newsevents.html">News
&amp; Events</a></li>                           
                        <li><a
href="cluborganization.html">Club Organization
Chart</a></li>          
                    </ul>
                </div>
                <div class="block">
                    <ul>
                      <li><a
href="equipments.html">Equipments</a></li>
                      <li><a
href="benefits.html">Benefits</a></li>
                        <li><a
href="techniques.html">Techniques</a></li>
                        <li><a href="riles.html">Rules of
Tennis</a></li>
                        <li><a
href="equipments.html">Image Map</a></li>
                    </ul>
                </div>
                <div class="block">
                    <ul>
                      <li><a href="tennisclub.html">Tennis
Club</a></li>
                        <li><a
href="cluborganization.html">Organization
Chart</a></li>
                        <li><a
href="membership/form.html">Membership</a></li>
                        <li><a
href="contact_us.html">Announcement</a></li>
                    </ul>
                </div>
            </div>
            <div id="footer-right">
                <h4>Get in touch with us</h4>
                <img src="images/logo-test.png" width="90"/>
                <p>
                    <strong>Harbour Island Tennis
Centre</strong><br/>
                </p>
            </div>
        </footer>
    </div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

If hard to see can be downloaded here:

https://www.dropbox.com/s/8p5mnc8e9inmxoj/Announcement.zip?dl=0

I would really really appreciate your help..

Thank you very much


getting duplicated value in xsl:for tag while xml transformation
ASP & ASP.net

I have the below xml

 <?xml version="1.0" encoding="UTF-8"?>
<Report xmlns:fpml="http://www.fpml.org/FpML-5/confirmation"
xmlns="http://www.eurexchange.com/EurexIRSFullInventoryReport"
name="CB202 Full Inventory Report">
<reportNameGrp>
<CM>
<acctTypGrp name="A9">
<ProductType name="Swap">
</ProductType>
</acctTypGrp>
<acctTypGrp name="P">
<ProductType name="Swap">
</ProductType>
<ProductType name="FRA">
</ProductType>
</acctTypGrp>
</CM>
</reportNameGrp>
</Report>

and for which i have written the xsl for xml transformation , I have written the xslt below

<xsl:stylesheet version="1.0" 
xmlns:fpml="http://www.fpml.org/FpML-5/confirmation"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:eur="http://www.eurexchange.com/EurexIRSFullInventoryReport" 
    xmlns:java="http://xml.apache.org/xslt/java"   
exclude-result-prefixes="java">
     <xsl:output method="xml" version="1.0" encoding="UTF-8"
indent="yes" omit-xml-declaration="yes"/>


    <!-- Main Template starts from here -->
  <xsl:template match="/eur:Report">
    <Eurexflows>
    <xsl:call-template name="EurexreportNameGrp_block">
    <xsl:with-param name="CMaccounttypeGroup"
select="/eur:Report/eur:reportNameGrp/eur:CM/eur:acctTypGrp" />
    </xsl:call-template>
    </Eurexflows>
    </xsl:template>

    <!-- Main tempalte ends --> 

    <!-- sub templates starts -->     
   <xsl:template name="EurexreportNameGrp_block">
    <xsl:param name="CMaccounttypeGroup" />
    <xsl:for-each select="$CMaccounttypeGroup">
      <EurexMessageObject>
     <name>
        <xsl:value-of select="@name" />
     </name>
     <ProductType>
     <xsl:value-of
select="$CMaccounttypeGroup/eur:ProductType/@name" />
     <xsl:call-template name="generateData">
            <xsl:with-param name="data" select="."/>
          </xsl:call-template>
     </ProductType>
     </EurexMessageObject>
</xsl:for-each>
</xsl:template>
<xsl:template name="generateData">
        <xsl:param name="data" />
        <xsl:for-each select="$data/eur:ProductType">
            <xsl:value-of select="./@name" />
    </xsl:for-each>
    </xsl:template> 
    </xsl:stylesheet>

but upon xsl transformation I am getting the xml in below format

<Eurexflows
xmlns:eur="http://www.eurexchange.com/EurexIRSFullInventoryReport"
    xmlns:fpml="http://www.fpml.org/FpML-5/confirmation">
    <EurexMessageObject>
        <name>A9</name>
        <ProductType>SwapSwap</ProductType>
    </EurexMessageObject>
    <EurexMessageObject>
        <name>P</name>
        <ProductType>SwapSwapFRA</ProductType>
    </EurexMessageObject>
</Eurexflows>

but I want xml in this format,

<Eurexflows
xmlns:eur="http://www.eurexchange.com/EurexIRSFullInventoryReport"
    xmlns:fpml="http://www.fpml.org/FpML-5/confirmation">
    <EurexMessageObject>
        <name>A9</name>
        <ProductType>Swap</ProductType>
    </EurexMessageObject>
    <EurexMessageObject>
        <name>P</name>
        <ProductType>Swap</ProductType>
    </EurexMessageObject>
    <EurexMessageObject>
        <name>P</name>
        <ProductType>FRA</ProductType>
    </EurexMessageObject>
</Eurexflows>

please avise how to achieve the above xml after transformation and also please advise what necessary changes i need to do in xsl specially in my generateData template..please advise folks


XSLT for XML to XML transformation by reading data from another XML
ASP & ASP.net

I am trying to update an element in below XML using data in secondary or different xml file. Both input XML and secondary XML file has equal number of segments. I need to take a value in first segment of secondary XML and update an element in INPUT xml and so on. I am not sure whether it can be done using XSL or not, can anyone guide me.

To be more specific, i am trying to update INPUT XML's <indicator></indicator> value in each <iOSection> based on secondary XML's $RSPDetails/RS/PDetails/PStatus and $RSPDetails/RS/PDetails/Message values.

Below is INPUT XML file:

<IResponse>
    <iOSection>
        <Details>           
            <Info>
                <pNumber>FB061689</pNumber>
                <indicator></indicator>
                <Identifier>1</Identifier>
            </Info>         
        </Details>
        <Token>
            <Reference>1UUYD05BHM21OJCK3881C7F</Reference>
        </Token>
    </iOSection>
    <iOSection>
        <Details>           
            <Info>
                <pNumber>FB061690</pNumber>
                <indicator></indicator>
                <Identifier>2</Identifier>
            </Info>
        </Details>
        <Token>
            <Reference>1UUYD05BHM21OJCK3881C7F</Reference>
        </Token>
    </iOSection>
</IResponse>

below is secondary XML file - it is available in xsl variable called RSPDetails
FB063586 0 Cancelled
92 failed

The value of should be 'YES' when RS/PDetails/PStatus = '0' and RS/PDetails/Message = 'Cancelled' , in all other cases it should be 'NO'

The condition should apply for position 1 using position 1 data and position 2 using position 2 data and so on

Expecting OUTPUT is:

<IResponse>
    <iOSection>
        <Details>           
            <Info>
                <pNumber>FB061689</pNumber>
                <indicator>YES</indicator>
                <Identifier>1</Identifier>
            </Info>         
        </Details>
        <Token>
            <Reference>1UUYD05BHM21OJCK3881C7F</Reference>
        </Token>
    </iOSection>
    <iOSection>
        <Details>           
            <Info>
                <pNumber>FB061690</pNumber>
                <indicator>NO</indicator>
                <Identifier>2</Identifier>
            </Info>
        </Details>
        <Token>
            <Reference>1UUYD05BHM21OJCK3881C7F</Reference>
        </Token>
    </iOSection>
</IResponse>

I tried below XSL, but not getting anywhere closer

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="#all" >

    <xsl:template match="@* | node()">
        <xsl:copy>
            <xsl:apply-templates select="@* | node()"/>
        </xsl:copy>
    </xsl:template>

    <xsl:template
match="/*[local-name()='IResponse']/*[local-name()='iOSection']/*[local-name()='Details']/*[local-name()='Info']/*[local-name()='indicator']">

        <xsl:variable name="RSDetails">
            <RS PartID="abcd" SysID="mnc">
                <PDetails>
                    <PN>FB063586</PN>
                    <PStatus>
                        <Code>0</Code>
                       
<Description>Cancelled</Description>
                    </PStatus>
                </PDetails>
                <PDetails>
                    <Error>
                        <Code>92</Code>
                        <Message>failed</Message>
                    </Error>
                </PDetails>
            </RS>       
        </xsl:variable> 

        <xsl:element name="indicator">
            <xsl:variable name="PStatus">
                <xsl:value-of
select="$RSDetails/RS/PDetails/PStatus" />
            </xsl:variable>
            <xsl:variable name="Message">
                <xsl:value-of
select="$RSDetails/RS/PDetails/Message" />
            </xsl:variable>

            <xsl:choose>
                <xsl:when test="$PStatus='0' and
$Message='Cancelled'">
                    <xsl:value-of select="'YES'" />
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="'NO'" />
                </xsl:otherwise>
            </xsl:choose>

        </xsl:element>
        <xsl:copy-of select="@*" />
    </xsl:template>
</xsl:stylesheet>


HD Wallpapers
3D
3D Abstract
City
Celebrities
Indian Celebrities
Cars
Travel
Girls
Animals Birds
Movies
Sports
Black White
Nature
Planes
Anime
Food Drink
Dreamy Fantasy
Architecture
Games
Space
Holidays
Flowers
Love
Artistic
Baby
Beach
Bikes Motorcycles
Macro
Computers
Vector
Funny
Army
Textures
Brands
Misc
Music
Other
Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .