Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 19th, 2005, 03:00 AM
Authorized User
 
Join Date: Jul 2005
Location: bangalore, karnataka, India.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default help needed for xslt

HI all,
         i have one xml file that contains details about both forms and tables of my application.Now i need to extract values of both forms and tables from that xml file.


xml file:


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



<Database xmlns="http://www.merunetworks.com/namespace/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.merunetworks.com/namespace/
meru.xsd">
    <Entries>
        <Form name="auth_stats" description="Authentication Statistics" mibcategory="mwGlobalStatistics" mibcategoryindex="3" usedin="wnc" tabletype="database" mailbox="COMM_MBXID_NMS_STAT_MANAGER" polling="true">
            <Header>
                <Field name="Auth8021xRequestCount" description="802.1x Authentication Request Count" edittype="read-only" type="integer" nativetype="uint64_t"/>
                <Field name="Auth8021xSuccessCount" description="802.1x Authentication Success Count" edittype="read-only" type="integer" nativetype="uint64_t"/>
                <Field name="Auth8021xFailureCount" description="802.1x Authentication Failure Count" edittype="read-only" type="integer" nativetype="uint64_t"/>
                <Field name="Auth8021xStationCount" description="802.1x Authentication Station Count" edittype="read-only" type="integer" nativetype="uint64_t"/>
                <Field name="AuthWepRequestCount" description="WEP Authentication Request Count" edittype="hidden" type="integer" nativetype="uint64_t"/>
                <Field name="AuthWepSuccessCount" description="WEP Authentication Success Count" edittype="hidden" type="integer" nativetype="uint64_t"/>
                <Field name="AuthWepFailureCount" description="WEP Authentication Failure Count" edittype="hidden" type="integer" nativetype="uint64_t"/>
                <Field name="AuthWepStationCount" description="WEP Authentication Station Count" edittype="hidden" type="integer" nativetype="uint64_t"/>
                <Field name="ControlFlag" description="Control Flag" edittype="hidden" type="integer" nativetype="uint32_t"/>
                <Statistics name="Auth802" description="802.1x Authentication Statistics" statstype="absolute" displaytype="piechart" multiplefields="false">
                    <Fieldname name="Auth8021xSuccessCount"/>
                    <Fieldname name="Auth8021xFailureCount"/>
                </Statistics>
                <Statistics name="AuthWep" description="WEP Authentication Statistics" statstype="absolute" displaytype="piechart" multiplefields="false">
                    <Fieldname name="AuthWepSuccessCount"/>
                    <Fieldname name="AuthWepFailureCount"/>
                </Statistics>
                <Capabilities>
                    <Cap name="read" description="Refresh"/>
                    <!--
                    <Cap name="statistics" description="Graphs ..."/>
-->
                </Capabilities>
            </Header>
        </Form>
        <Form name="meru_vars" description="Meru Variables" usedin="wnc" tabletype="database" mailbox="COMM_MBXID_NMS_CONFIG_MANAGER" edittype="hidden">
            <Header>
                <Field name="LastAtsId" description="Last AP ID" edittype="read-only" type="integer" nativetype="uint16_t"/>
                <Field name="LastAscId" description="Last ASC ID" edittype="read-only" type="integer" nativetype="uint16_t"/>
                <Field name="LastIkePolicyId" description="Last Ike Policy Id" edittype="hidden" type="integer" nativetype="uint32_t"/>
                <Field name="LastIpSecProfileId" description="Last Ipsec Profile Id" edittype="hidden" type="integer" nativetype="uint32_t"/>
                <Field name="LastConnTemplateId" description="Last Connection template id" edittype="hidden" type="integer" nativetype="uint32_t"/>
                <Field name="LastVpnClientWebPageStoreId" description="Last VPN client web page store config id" edittype="hidden" type="integer" nativetype="uint32_t"/>
                <Capabilities>
                    <Cap name="read" description="Refresh"/>
                </Capabilities>
            </Header>
        </Form>
        <Form name="ike_policy" description="Global IKE Policy Parameters" mibcategory="mwConfigVlan" mibcategoryindex="3" usedin="wnc" tabletype="database" mailbox="COMM_MBXID_NMS_CONFIG_MANAGER">
            <Header>
                <Field name="IkePolicyId" description="Policy Id" shortdescription="Id" edittype="read-only" keyfield="true" type="integer" nativetype="uint32_t"/>
                <Field name="IkePolicyName" description="Policy Name" shortdescription="Name" edittype="hidden" type="string" nativetype="char const*"/>
                <Field name="EncryptionAlgorithm" description="Encrypt Algorithm" shortdescription="Encryption Algorithm" edittype="read-only" type="enumeration" enumeration="IpEncryptionAlgorithm" nativetype="NmsIpEncryptionAlgorithm_t" defvalue="3DES"/>
                <Field name="AuthenticateAlgorithm" description="Auth Algorithm" shortdescription="Authentication Alogrithm" edittype="read-only" type="enumeration" enumeration="IpAuthenticateAlgorithm" nativetype="NmsIpAuthenticateAlgorithm_t" defvalue="Pre-shared-Key"/>
                <Field name="HashAlgorithm" description="Hash Algorithm" shortdescription="Hash Alogrithm" edittype="hidden" type="enumeration" enumeration="IpHashAlgorithm" nativetype="NmsIpHashAlgorithm_t" defvalue="sha"/>
                <Field name="PFSEnabled" description="PFS Enabled" shortdescription="PFS" edittype="read-only" type="enumeration" enumeration="OnOffSwitch" nativetype="NmsOnOff_t" defvalue="off"/>
                <Field name="DHGroup" description="Diffie-Hellman Group" shortdescription="DH Group" edittype="read-only" type="enumeration" enumeration="DhGroupType" nativetype="NmsDhGroupType_t" defvalue="2"/>
                <Field name="IkeLifeTime" description="Global IKE Life Time" shortdescription="lifetime" edittype="read-write" type="integer" nativetype="uint32_t" minval="60" maxval="28000" defvalue="28000"/>
                <Capabilities>
                    <Cap name="read" description="Refresh"/>
                    <Cap name="update" description="OK"/>
                </Capabilities>
                <HeaderExtraPre>

#define M_IKE_LIFETIME_MIN 60
#define M_IKE_LIFETIME_MAX 28000

#define M_DEFAULT_IKE_ENCRYP_ALGO ENCRYPTION_3DES
#define M_DEFAULT_IKE_AUTH_ALGO AUTH_PRE_SHARE_KEY
#define M_DEFAULT_IKE_HASH_ALGO HASH_SHA
#define M_DEFAULT_IKE_PFS_ENABLED NMS_OFF
#define M_DEFAULT_IKE_DH_GROUP DH_GROUP_2
#define M_DEFAULT_IKE_LIFETIME 28000 /* 8 hours */
#define M_DEFAULT_IKE_POLICY_NAME "default"

#define M_POLICY_NAME_LEN 64</HeaderExtraPre>
            </Header>
        </Form>
        <Form name="ipsec_profile" description="IPSec Profile" mibcategory="mwConfigVlan" mibcategoryindex="4" usedin="wnc" tabletype="database" mailbox="COMM_MBXID_NMS_CONFIG_MANAGER">
            <Header>
                <Field name="ProfileId" description="Id" shortdescription="Id" edittype="hidden" type="integer" nativetype="uint32_t"/>
                <Field name="ProfileName" description="Name" shortdescription="Name" edittype="read-only" keyfield="true" type="string" nativetype="char const*"/>
                <Field name="IpSecMode" description="IPSec Mode" shortdescription="Mode" edittype="read-only" type="enumeration" enumeration="IpSecModeType" nativetype="NmsIpSecMode_t" defvalue="TUNNEL"/>
                <Field name="IpSecDataChannelType" description="IPSec Data Channel" shortdescription="channel" edittype="read-only" type="enumeration" enumeration="IpSecDataChannelType" nativetype="NmsIpSecDataChannelType_t" defvalue="ESP"/>
                <Field name="EncryptionAlgorithm" description="Encryption Algorithm" shortdescription="encryption" edittype="read-only" type="enumeration" enumeration="IpEncryptionAlgorithm" nativetype="NmsIpEncryptionAlgorithm_t" defvalue="3DES"/>
                <Field name="AuthAlgorithm" description="Authentication Algorithm" shortdescription="Authentication" edittype="hidden" type="enumeration" enumeration="IpSecAuthAlgorithm" nativetype="NmsIpSecAuthAlgorithm_t" defvalue="SHA-HMAC"/>
                <Capabilities>
                    <Cap name="read" description="Refresh"/>
                </Capabilities>
                <HeaderExtraPre>#define M_DEFAULT_IPSEC_MODE IPSEC_TUNNEL_MODE
#define M_DEFAULT_IPSEC_TYPE IPSEC_ESP
#define M_DEFAULT_IPSEC_ENCRYPT_ALGO ENCRYPTION_3DES
#define M_DEFAULT_IPSEC_AUTH_ALGO IPSEC_AUTH_SHA_HMAC
#define M_DEFAULT_IPSEC_IP_COMPRESSION NMS_OFF

#define MAX_PROFILE_NAME_LEN 64
#define M_DEFAULT_PROFILE_NAME "default"

</HeaderExtraPre>
            </Header>
        </Form>
        <Form name="qos_stats" description="Global Quality-of-Service Statistics" mibcategory="mwGlobalStatistics" mibcategoryindex="4" usedin="wnc" tabletype="database" mailbox="COMM_MBXID_NMS_STAT_MANAGER" polling="true">
            <Header>
                <Field name="SessionCount" description="Session Count" edittype="read-only" type="integer" nativetype="uint64_t"/>
                <Field name="HttpSessionCount" description="HTTP Session Count" edittype="hidden" type="integer" nativetype="uint64_t"/>
                <Field name="H323SessionCount" description="H.323 Session Count" edittype="read-only" type="integer" nativetype="uint64_t"/>
                <Field name="SipSessionCount" description="SIP Session Count" edittype="read-only" type="integer" nativetype="uint64_t"/>
                <Field name="SccpSessionCount" description="SCCP Session Count" edittype="read-only" type="integer" nativetype="uint64_t"/>
                <Field name="RejectedSessionCount" description="Rejected Session Count" edittype="read-only" type="integer" nativetype="uint64_t"/>
                <Field name="RejectedHttpSessionCount" description="Rejected HTTP Session Count" edittype="hidden" type="integer" nativetype="uint64_t"/>
                <Field name="RejectedH323SessionCount" description="Rejected H.323 Session Count" edittype="read-only" type="integer" nativetype="uint64_t"/>
                <Field name="RejectedSipSessionCount" description="Rejected SIP Session Count" edittype="read-only" type="integer" nativetype="uint64_t"/>
                <Field name="RejectedSccpSessionCount" description="Rejected SCCP Session Count" edittype="read-only" type="integer" nativetype="uint64_t"/>
                <Field name="PendingSessionCount" description="Pending Session Count" edittype="read-only" type="integer" nativetype="uint64_t"/>
                <Field name="HttpPendingSessionCount" description="Pending HTTP Session Count" edittype="hidden" type="integer" nativetype="uint64_t"/>
                <Field name="H323PendingSessionCount" description="Pending H.323 Session Count" edittype="read-only" type="integer" nativetype="uint64_t"/>
                <Field name="SipPendingSessionCount" description="Pending SIP Session Count" edittype="read-only" type="integer" nativetype="uint64_t"/>
                <Field name="SccpPendingSessionCount" description="Pending SCCP Session Count" edittype="read-only" type="integer" nativetype="uint64_t"/>
                <Field name="QosActiveFlowCount" description="Active Flows" edittype="read-only" type="integer" nativetype="uint64_t"/>
                <Field name="QosPendingFlowCount" description="Pending Flows" edittype="read-only" type="integer" nativetype="uint64_t"/>
                <Field name="ControlFlag" description="Control Flag" edittype="hidden" type="integer" nativetype="uint32_t"/>
                <Capabilities>
                    <Cap name="read" description="Refresh"/>
                </Capabilities>
            </Header>
        </Form>
        <Form name="qos_vars" description="Global Quality-of-Service Parameters" mibcategory="mwConfigQoS" mibcategoryindex="1" usedin="wnc" tabletype="database" mailbox="COMM_MBXID_NMS_CONFIG_MANAGER" scope="global">
            <Header>
                <Field name="QosOnOff" description="On/Off" edittype="read-only" type="enumeration" enumeration="OnOffSwitch" nativetype="NmsOnOff_t" errordescription="Qos On/Off switch"/>
                <Field name="QosAdmissionControl" description="Admission Control" edittype="read-write" type="enumeration" nativetype="AdmissionControlSwitch_t" enumeration="AdmissionControl" defvalue="admitall" errordescription="QoS admission control"/>
                <Field name="QosDropPolicy" description="Drop Policy" edittype="read-write" type="enumeration" nativetype="NmsDropPolicy_t" enumeration="DropPolicy" defvalue="head" errordescription="QoS drop policy"/>
                <Field name="QosDefaultTimeToLive" description="Default Time-to-live (seconds)" edittype="read-write" type="integer" minval="0" maxval="65535" nativetype="uint32_t" errordescription="Qos default TTL"/>
                <Field name="QosUdpTimeToLive" description="UDP Time-to-live (seconds)" edittype="read-write" type="integer" minval="0" maxval="65535" nativetype="uint32_t" errordescription="Qos UDP TTL"/>
                <Field name="QosTcpTimeToLive" description="TCP Time-to-live (seconds)" edittype="read-write" type="integer" minval="0" maxval="65535" nativetype="uint32_t" errordescription="Qos TCP TTL"/>
                <Field name="QosDefaultStealTime" description="Default Steal Time (seconds)" edittype="hidden" type="integer" nativetype="uint32_t"/>
                <Field name="QosUdpStealTime" description="UDP Steal TIme (seconds)" edittype="hidden" type="integer" nativetype="uint32_t"/>
                <Field name="QosTcpStealTime" description="TCP Steal Time (seconds)" edittype="hidden" type="integer" nativetype="uint32_t"/>
                <Field name="PercentBWScaling" description="Bandwidth Scaling (percent)" edittype="read-write" type="integer" minval="0" maxval="100000" nativetype="uint32_t" errordescription="Bandwidth scaling factor"/>
                <Field name="QosIntercellPeriodicity" description="Intercell Periodicity (ms)" edittype="read-write" type="integer" minval="10" maxval="100" defvalue="30" nativetype="uint32_t" errordescription="Qos Intercell Periodicity"/>
                <Field name="QosMaxCallsPerAp" description="Maximum Calls Per AP" edittype="read-write" type="integer" minval="0" maxval="256" nativetype="uint32_t" errordescription="Qos Maximum Calls Per AP"/>
                                <Field name="QosLoadBalanceMaxStationsPerAp" description="Maximum Stations Per AP" edittype="read-write" type="integer" minval="0" maxval="128" nativetype="uint32_t" errordescription="Maximum Stations Per AP"/>
                                <Field name="QosLoadBalanceMaxStationsPerBssid" description="Maximum Stations Per BSSID" edittype="read-write" type="integer" minval="0" maxval="1023" nativetype="uint32_t" errordescription="Maximum Stations Per BSSID"/>
                                <Field name="QosLoadBalanceOverflow" description="Load Balance Overflow" edittype="read-write" type="enumeration" enumeration="OnOffSwitch" nativetype="NmsOnOff_t" errordescription="Allow Round-Robin Overflow on Max Stations per BSSID"/>
                                <Field name="QosMaxCallsPerBssid" description="Maximum Calls Per BSSID" edittype="read-write" type="integer" minval="0" maxval="1023" nativetype="uint32_t" errordescription="Qos Maximum Calls Per BSSID"/>
                <Field name="QosCacDeauth" description="CAC Deauth" edittype="read-write" type="enumeration" enumeration="OnOffSwitch" nativetype="NmsOnOff_t" errordescription="Upon CAC limit exceeded, deauthenticate client for load balancing."/>
                <Field name="QosStationAssignAge" description="Station Assignment Age Time" edittype="read-write" type="integer" minval="5" maxval="2000" default="30" nativetype="uint32_t" errordescription="Station Assignment Age Time"/>
                <Field name="QosProxyType" description="IP Proxy Type " edittype="hidden" type="enumeration" enumeration="IpProxyType" nativetype="NmsIpProxyType_t" errordescription="IP Proxy Type" group="true"/>
                <Capabilities>
                    <Cap name="read" description="Refresh"/>
                    <Cap name="update" description="OK"/>
                </Capabilities>
                <HeaderExtraPre>#define MIN_QOS_PERCENT_BW_SCALING 1
#define MAX_QOS_PERCENT_BW_SCALING 100000
#define DEFAULT_QOS_PERCENT_BW_SCALING 100

</HeaderExtraPre>
            </Header>
        </Form>
        <Form name="rogueap_vars" description="Global Settings" mibcategory="mwConfigRogueAp" mibcategoryindex="1" usedin="all" tabletype="database" mailbox="COMM_MBXID_NMS_CONFIG_MANAGER" scope="global">
            <Header>
                <Field name="Detection" description="Detection" shortdescription="Detection" edittype="read-write" type="enumeration" enumeration="OnOffSwitch" nativetype="NmsOnOff_t" errordescription="Detection"/>
                <Field name="Block" description="Mitigation" shortdescription="Mitigation" edittype="read-write" type="enumeration" enumeration="Block" nativetype="NmsBlock_t" errordescription="Block"/>
                <Field name="Log" description="Logging" shortdescription="Log" edittype="hidden" type="enumeration" enumeration="OnOffSwitch" nativetype="NmsOnOff_t" errordescription="Logging"/>
                <Field name="Aging" description="Rogue AP Aging (seconds)" shortdescription="Aging" edittype="read-write" type="integer" minval="60" maxval="65535" nativetype="uint32_t" errordescription="Rogue AP Aging"/>
                <Field name="MitigateAps" description="Number of Candidate APs" shortdescription="Number Of Candidate APs" edittype="read-write" type="integer" nativetype="uint32_t" errordescription="Number of Candidate APs"/>
                <Field name="MitigateAlgorithm" description="AP Assignment Algorithm" shortdescription="Algorithm" edittype="read-write" type="enumeration" enumeration="AssignMitigateAlgorithm" nativetype="NmsAssignMitigateAlgorithm_t" errordescription="Mitigating AP Assignment Algorithm"/>
                <Capabilities>
                    <Cap name="read" description="Refresh"/>
                    <Cap name="update" description="OK"/>
                </Capabilities>
                <HeaderExtraPre>

#define M_ROGUEAP_VARS_AGING_DEFAULT 60
#define M_ROGUEAP_VARS_BLOCK_DEFAULT BLOCK_NONE
#define M_ROGUEAP_VARS_LOG_DEFAULT NMS_OFF
#define M_ROGUEAP_VARS_DETECTION_DEFAULT NMS_OFF


#define M_ROGUEAP_VARS_AGING_MIN 60
#define M_ROGUEAP_VARS_AGING_MAX 86400

#define M_ROGUEAP_VARS_NUM_MITIGATE_APS_DEFAULT 3
#define M_ROGUEAP_VARS_ALGORITHM_DEFAULT RSSI_ALGORITHM
#define M_ROGUEAP_VARS_MAX_NUM_ALGORITHMS 2

                                 </HeaderExtraPre>
            </Header>
        </Form>
        <Form name="system_file_vars" description="System Variables" mibcategory="mwConfigController" mibcategoryindex="3" usedin="wnc" tabletype="database" mailbox="COMM_MBXID_NMS_CONFIG_MANAGER" reboot="true">
            <Header>
                <Field name="pHostName" description="Host Name" edittype="read-write" type="strnosp" nativetype="char const*" errordescription="Host name" minlength="0" maxlength="16" reboot="true"/>
                <Field name="pUdpIfName" description="UDP Interface Name" edittype="hidden" type="strnosp" nativetype="char const*" errordescription="Interface name" minlength="0" maxlength="16"/>
                <Field name="pDnsDomainName" description="DNS Domain Name" edittype="read-write" type="string" nativetype="char const*" errordescription="DNS domain name" minlength="0" maxlength="64" reboot="true"/>
                <Capabilities>
                    <Cap name="read" description="Refresh"/>
                    <Cap name="update" description="OK"/>
                </Capabilities>
                <HeaderExtraPre>#define WNC_MAX_HOST_NAME_SIZE 64 // same as constants defined in syscntl.h

</HeaderExtraPre>
            </Header>
        </Form>


Reply With Quote
  #2 (permalink)  
Old September 19th, 2005, 03:34 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

It's useful to think a little about the people who might be willing to answer your question: this will help you to formulate your question more clearly, making it more likely you will get an answer. Some suggestions:

(a) use a subject line that explains the nature of your problem. Everyone posting on an XSLT forum wants help with XSLT: be more specific.

(b) don't post pages of source XML. Cut it down to an example of 5 or 10 lines that illustrates the essence of the problem.

(c) the best way of explaining what you want to do is to show the output you are trying to achieve. For all I can tell from your question, an output file that is identical to the input would meet your requirement.

(d) explain where you are having difficulty: what have you tried already? Ideally show your best attempt at a stylesheet to solve the problem. This will help to show readers the extent of your XSLT knowledge and the features of the language that need to be explained. No-one wants to waste their time explaining things you aready know, or explaining advanced features when you haven't yet mastered the basics.



Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote
  #3 (permalink)  
Old September 19th, 2005, 03:58 AM
Authorized User
 
Join Date: Jul 2005
Location: bangalore, karnataka, India.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

xml:this is input xml file that contains details about tables and forms which are being used in our application.

     <database>
        <entries>
           <table name="table name" description="des about table">
              <field name="some name" description="something">
              </field>
           </table> </entries>
    <database>


    <database>
        <entries>
           <form name="table name" description="des about table">
              <field name="some name" description="something">
              </field>
           </form> </entries>
    <database>


output:


its a table that contains three columns like

table name | field name | description

similarlly

form name | field name | description


or


print table then under the table name
i need to print corresponding field name and description

similarlly for forms also.





Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help needed on XSLT baruprasad XSLT 8 October 21st, 2008 09:03 AM
help needed in XSLT ddeokarb XSLT 1 November 22nd, 2007 10:41 AM
XSLT Help Needed JZen XSLT 9 February 22nd, 2007 04:27 AM
xslt help desperately needed daula7 XSLT 2 May 10th, 2006 12:09 PM
help needed regarding xslt pradeep.mallavarapu XSLT 1 April 19th, 2006 05:58 AM



All times are GMT -4. The time now is 02:07 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.