skip to Main Content

So, basically I’m trying to display a description from my xml to be like in the picture. I have created my .xml, .dtd, .css and .xslt and this my current .xml looks like. The thing that still confuse me is I have different description on each books.

This is a part from my xml

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE items SYSTEM "workshop.dtd">
<?xml-stylesheet type="text/xsl" href="workshop.xslt"?>
<items> 
    <item type="ebook">
        <title>Cyber-assurance for the internet of things</title>
        <author>
            <authorname>Tyson T. Brooks</authorname>
            <authorlink>https://ecu.on.worldcat.org/search?queryString=au:Tyson T. Brooks&amp;databaseList=3200,1461,2110,2108,2229,1931,2107,3838,3839,1697,3313,3036,1937,638,2507,1978,2109,3494,2481,3371,2513,3129,3404,2237,2038,2236,3369,1861,1982,2433,2795,2233,3967,2210,2375,2175,2570,3384,2051,3382,1953,1875,2007,2447,2006,2209,1834,2462,3034,3197,2261,2062,2260,1842,2259,3227,3502,2059,2211,3909</authorlink>
            <authorlink2></authorlink2>
        </author>
        <year>2017</year>
        <type>ebook</type>
        <thumbnail>cyberassurance.jpg</thumbnail>
        <link>https://ecu.on.worldcat.org/oclc/966445296</link>
        <description>
                    Publication:Hoboken, New Jersey : Wiley : IEEE Press, [2017]
                    Physical:   1 online resource
                    Language:   English 
                    Staff View: MARC Record 
                    ISBN:       9781119193784 1119193788 9781119193883 1119193885 9781119193876 1119193877 
                    OCLC Number: 966445296 
                    Contents:   Embedded Design Security. Certified Security by Design for the Internet of Things / Shiu-Kai Chin -- Cyber-Assurance Through Embedded Security for the Internet of Things / Tyson T Brooks, Joon Park -- A Secure Update Mechanism for Internet of Things Devices / Martin Goldberg -- Trust Impact. Security and Trust Management for the Internet of Things: An Rfid and Sensor Network Perspective / M Bala Krishna -- The Impact of IoT Devices on Network Trust Boundaries / Nicole Newmeyer -- Wearable Automation Provenance. Wearable IoT Computing: Interface, Emotions, Wearer'S Culture, and Security/Privacy Concerns / Robert Mccloud, Martha Lerski, Joon Park, Tyson T Brooks -- On Vulnerabilities of IoT-Based Consumer-Oriented Closed-Loop Control Automation Systems / Martin Murillo -- Big Data Complex Event Processing for Internet of Things Provenance: Benefits for Audit, Forensics, and Safety / Mark Underwood -- Cloud Artificial Intelligence Cyber-Physical Systems. A Steady-State Framework for Assessing Security Mechanisms in a Cloud-of-Things Architecture / Tyson T Brooks, Lee McKnight -- An Artificial Intelligence Perspective on Ensuring Cyber-Assurance for the Internet of Things / Utku Kose -- Perceived Threat Modeling for Cyber-Physical Systems / Christopher Leberknight.
                    Subjects:   Internet of things Security measures. 
                                COMPUTERS Computer Literacy. 
                                COMPUTERS Computer Science. 
                                COMPUTERS Data Processing. 
                                COMPUTERS Hardware General. 
                                COMPUTERS Information Technology. 
                                COMPUTERS Machine Theory. 
                                COMPUTERS Reference. 
                    Summary: Presents an Cyber-Assurance approach to the Internet of Things (IoT) This book discusses the cyber-assurance needs of the IoT environment, highlighting key information assurance (IA) IoT issues and identifying the associated security implications. Through contributions from cyber-assurance, IA, information security and IoT industry practitioners and experts, the text covers fundamental and advanced concepts necessary to grasp current IA issues, challenges, and solutions for the IoT. The future trends in IoT infrastructures, architectures and applications are also examined. Other topics discussed include the IA protection of IoT systems and information being stored, processed or transmitted from unauthorized access or modification of machine-2-machine (M2M) devices, radio-frequency identification (RFID) networks, wireless sensor networks, smart grids, and supervisory control and data acquisition (SCADA) systems. The book also discusses IA measures necessary to detect, protect, and defend IoT information and networks/systems to ensure their availability, integrity, authentication, confidentially, and non-repudiation. . Discusses current research and emerging trends in IA theory, applications, architecture and information security in the IoT based on theoretical aspects and studies of practical applications. Aids readers in understanding how to design and build cyber-assurance into the IoT. Exposes engineers and designers to new strategies and emerging standards, and promotes active development of cyber-assurance. Covers challenging issues as well as potential solutions, encouraging discussion and debate amongst those in the field Cyber-Assurance for the Internet of Things is written for researchers and professionals working in the field of wireless technologies, information security architecture, and security system design. This book will also serve as a reference for professors and students involved in IA and IoT networking. 
                    Genre: Electronic books. 
                    Bibliography: Includes bibliographical references and index. 
                    Database: WorldCat
        </description>
        <formats>
            <nameformat>View all editions and formats</nameformat>
            <linkformat>https://ecu.on.worldcat.org/oclc/966445296#editions-panel966445296-section</linkformat>
        </formats>
        <source></source>
        <holder>
            <name>Edith Cowan University</name>
            <linkholder>https://ecu.on.worldcat.org/search?queryString=bn%3A1119193788</linkholder>
        </holder>
    </item>

Here’s my xslt

    <?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>Internet of Things</title>
        <link rel="stylesheet" type="text/css" href="workshop.css" />
    </head>
    <body>
        <h1>Internet of things</h1>
        <xsl:for-each select="items/item">
        <xsl:sort select="year" order="ascending"/>
            <div class="imgColumn">
                <img>
                    <xsl:attribute name="src">
                        <xsl:value-of select="thumbnail" />
                    </xsl:attribute>
                </img>
            </div>
            <div class="textColumn">
                <strong><a href="{link}"><xsl:value-of select="title" /></a><br /></strong>
                by <a href="{author/authorlink}"><xsl:value-of select="author/authorname" /></a><br />
                <xsl:value-of select="type" /> | <xsl:value-of select="year" /> | <a href="{formats/linkformat}"><xsl:value-of select="formats/nameformat" /></a><br />
                <xsl:value-of select="description" /><br />
                Source: <xsl:value-of select="source" /><br />
                Holder: <a href="{holder/linkholder}"><xsl:value-of select="holder/name" /></a><br />
            </div>
        </xsl:for-each>
    </body>
</html>
</xsl:template>
</xsl:stylesheet>

I’m new in markup languages, and I’m looking forward for your help.

2

Answers


  1. You are having trouble with white space. Normally, sequences of white space are collapsed into a single character, so your displayed HTML document will not have the line breaks from your XML file.

    Instead of div you could use PRE or you would have to adress the linebreaks within your XSLT to group the content of description into seperate elements.

    Login or Signup to reply.
  2. Your XML document contains structured and unstructured parts. I would be inclined to start by converting it to fully-structured form by parsing the free-text description into something like:

    <Publication>Hoboken, New Jersey : Wiley : IEEE Press, [2017]</Publication>
    <Physical>1 online resource</Physical>
    ...
    <Subjects>
      <Subject>Internet of things Security measures.</Subject>
      <SubjectsCOMPUTERS Computer Literacy.</Subject>
      ...
    </Subjects>
    

    Once you’ve done that, you can start to use the information in a much more flexible way.

    In XSLT 2.0 the parsing isn’t too difficult. Break it into lines using tokenize(); use xsl:for-each-group to start a new group on any line containing a colon; create a new element for each group, with multiple sub-elements if the group contains more than one line.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search