XQuery Labs Basic Reporting Date: 9/29/2008 Dan McCreary President Dan McCreary & Associates (952) 931-9198 M D Metadata Solutions.

Slides:



Advertisements
Similar presentations
Minnesota Department of Education Metadata Registry Case Study Date: October 31 st, 2008 Dan McCreary President Dan McCreary & Associates
Advertisements

Advanced XSLT. Branching in XSLT XSLT is functional programming –The program evaluates a function –The function transforms one structure into another.
Table, List, Blocks, Inline Style
Working with Web Tables
Introduction to HTML & CSS
CG0119 Web Database Systems Parsing XML: using SimpleXML & XSLT.
Making Things Look Nice: Visual Appearance and CSS CMPT 281.
XML: Managing Data Exchange Stylesheets. Lesson Contents CSS The basic XSL file XSL transforms Templates Sort Numbering Parameters and Variables Datatypes.
CSS Statements, media queries, selectors, cascading Web Applications Martin Nečaský Department of Software Engineering, Faculty of Mathematics and Physics,
1 XQuery Web and Database Management System. 2 XQuery XQuery is to XML what SQL is to database tables XQuery is designed to query XML data What is XQuery?
1 XQuery Syntax Dan McCreary May, Basic Syntax XQuery vs. XML Where do we put… –Curly braces "{" and "} " –Parenthesis " (" and ") " –Square Brackets.
Using oXygen Using oXygen to build and execute XQuery applications on eXist Date: September 2008 Dan McCreary President Dan McCreary & Associates
1 Advanced Topics XML and Databases. 2 XML u Overview u Structure of XML Data –XML Document Type Definition DTD –Namespaces –XML Schema u Query and Transformation.
Overview of XPath Author: Dan McCreary Date: October, 2008 Version: 0.2 with TEI Examples M D.
TUTORIAL 8: Enhancing a Web Site with Advanced CSS
Databases & Data Warehouses Chapter 3 Database Processing.
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Akhila Kondai October 30, 2013.
Working with Namespaces Combining XML Vocabularies in a Compound Document.
WORKING WITH NAMESPACES
Pemrograman Berbasis WEB XML part 2 -Aurelio Rahmadian- Sumber: w3cschools.com.
IPUB 100 Lesson 2 Instructor Mark Lamontagne Homework Review.
Training Course 2 User Module Training Course 3 Data Administration Module Session 1 Orientation Session 2 User Interface Session 3 Database Administration.
Advanced Excel for Finance Professionals A self study material from South Asian Management Technologies Foundation.
NetTech Solutions Working with Web Elements Lesson 6.
Extensible Markup and Beyond
Sample Auto-generated XForms With XQuery Date: 1/17/2009 Dan McCreary President Dan McCreary & Associates (952) M D Metadata.
18 People Surveyed HTML (HyperText Markup Language) HTML “tags” Describes structure Building blocks Headings, paragraphs, lists, links, images, quotes,
Styling XForms Using CSS to make your forms look great Date: 10/9/2008 Dan McCreary President Dan McCreary & Associates (952)
Project Implementation for COSC 5050 Distributed Database Applications Lab3.
Title, meta, link, script.  The title looks like:  The tag defines the title of the document in the browser toolbar.  It also: ◦ Provides a title for.
Copyright © 2013 MyGraphicsLab / Pearson Education STRUCTURE AND HTML TAGS MyGraphicsLab: Adobe Dreamweaver CS6 ACA Certification Preparation for Web Communication.
Intro. to XML & XML DB Bun Yue Professor, CS/CIS UHCL.
Chapter 27 The World Wide Web and XML. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.27-2 Topics in this Chapter The Web and the Internet.
Metadata Management Case Study Date: 10/21/2008 Dan McCreary President Dan McCreary & Associates (952) M D Metadata Solutions.
Searching Business Data with MOSS 2007 Enterprise Search Presenter: Corey Roth Enterprise Consultant Stonebridge Blog:
EXist Indexing Using the right index for you data Date: 9/29/2008 Dan McCreary President Dan McCreary & Associates (952) M.
Recursive Functions Creating Hierarchical Reports Date: 9/30/2008 Dan McCreary President Dan McCreary & Associates (952) M.
Definition CSS “Short for Cascading Style Sheets, a new feature being added to HTML that gives both Web site developers and users more control over how.
1 Introduction  Extensible Markup Language (XML) –Uses tags to describe the structure of a document –Simplifies the process of sharing information –Extensible.
XQuery Functions Reusing XQuery Code Date: September, 2008 Dan McCreary President Dan McCreary & Associates (952) M D Metadata.
XP New Perspectives on XML, 2nd Edition Tutorial 2 1 TUTORIAL 2 WORKING WITH NAMESPACES.
HTML – Organizing Page Content. HTML Images img tag Required attribute: src
Auto-generation of Repeated Elements Part 2 of a series of XForms auto generation Date: 1/25/2008 Dan McCreary President Dan McCreary & Associates
Keyword Searching Weighted Federated Search with Key Word in Context Date: 10/2/2008 Dan McCreary President Dan McCreary & Associates
HTML – Organizing Page Content. HTML Images img tag Required attribute: src
XRX Basic CRUDS Create, Read, Update and Delete and Search XML Data Date: May 2011 Dan McCreary President Dan McCreary & Associates
1 Tutorial 12 Working with Namespaces Combining XML Vocabularies in a Compound Document.
Using oXygen 12 with XQuery Using oXygen to build and execute XQuery XQuery applications on eXist Date: April 2011 Dan McCreary President Dan McCreary.
Modifying HTML attributes and CSS values. Learning Objectives By the end of this lecture, you should be able to: – Select based on a class (as opposed.
With Microsoft Excel 2010 © 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Excel 2010.
Ch 13 HTML and CSS Web Standards Solutions A Web Standardistas’ Approach.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
Web Design Terminology Unit 2 STEM. 1. Accessibility – a web page or site that address the users limitations or disabilities 2. Active server page (ASP)
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
Apache Cocoon – XML Publishing Framework 데이터베이스 연구실 박사 1 학기 이 세영.
CS491B Software Design Lab Project Report Yuet-Chi Lee California State University, Los Angeles.
Creating and Processing Web Forms
Unit 4 Representing Web Data: XML
WORKING WITH NAMESPACES
Dan McCreary President Dan McCreary & Associates (952) M D
Chapter 7 Representing Web Data: XML
Essentials of HTML.
Cascading Style Sheets (Introduction)
Introduction to Web Authoring
Cascading Style Sheets (Introduction)
Sequences in XQuery Core data structure of XQuery Date: 8/25/2009
XRX Diagrams Application Architecture Diagrams Date: Aug 21st, 2008
Presentation transcript:

XQuery Labs Basic Reporting Date: 9/29/2008 Dan McCreary President Dan McCreary & Associates (952) M D Metadata Solutions

M D Copyright 2008 Dan McCreary & Associates2 Overview Hello World XML Report HTML List Limiting Results with subsequence HTML Table HTML Table with Header HTML Table with CSS HTML Table with Row Count HTML Table with Alternate Rows Shaded HTML Table with Links Getting Next N Rows

M D Copyright 2008 Dan McCreary & Associates3 Term Manager Home Page /db/apps/terms/index.xhtml

M D Copyright 2008 Dan McCreary & Associates4 The following lines may be omitted… xquery version "1.0"; declare option exist:serialize "method=xhtml media- type=text/html omit-xml-declaration=yes indent=yes"; let $collection := ‘/db/apps/terms/data’ or let $get-uri := request:get-uri() let $app-base := substring-before(substring-after($get- uri, '/exist/rest'), '/views/') let $collection := concat($app-base, '/data')

M D Copyright 2008 Dan McCreary & Associates5 Basic Structure of XQuery xquery version "1.0"; let $collection := ‘/db/apps/terms/data’ return { for $term in collection($collection)/term return $term }

M D Copyright 2008 Dan McCreary & Associates6 HTML Ordered List … return Terms { for $term in collection($collection)/term return {$term/name/text()} }

M D Copyright 2008 Dan McCreary & Associates7 Returning Just the First 30 Terms Terms { for $term in subsequence(collection($collection)/term, 1, 30) return {$term/name/text()} - {$term/definition[1]/text()} } start count

M D Copyright 2008 Dan McCreary & Associates8 HTML Table Output Terms and Defintions Term Definition { for $term in subsequence(collection($collection)/term, 1, 30) return {$term/name/text()} {$term/definition[1]/text()} }

M D Copyright 2008 Dan McCreary & Associates9 Order and First Definition { for $term in subsequence(collection($collection)/term, 1, 30) order by $term/name/text() return {$term/name/text()} {$term/definition[1]/text()} } only return the first definition

M D Copyright 2008 Dan McCreary & Associates10 Using Cascading Style Sheets return HTML Table Terms and Defintions

M D Copyright 2008 Dan McCreary & Associates11 Adding “at $count” to Query { for $term at $count in subsequence(collection($collection)/term, 1, 30) return {$count} {$term/name/text()} {$term/definition[1]/text()} }

M D Copyright 2008 Dan McCreary & Associates12 Conditional Styling { for $term at $count in subsequence(collection($collection)/term, 1, 30) return {if ($count mod 2) then (attribute {'bgcolor'} {'Lavender'}) else ()} {$count} {$term/name/text()} {$term/definition[1]/text()} }

M D Copyright 2008 Dan McCreary & Associates13 Adding a Link to the Name { for $term at $count in subsequence(collection($collection)/term, 1, 30) return {if ($count mod 2) then (attribute {'bgcolor'} {'Lavender'}) else ()} {$term/name/text()} {$term/definition[1]/text()} } This will allow the use to click on a term name and jump directly to the item viewer for the terms.

M D Copyright 2008 Dan McCreary & Associates14 Getting N More Records let $start := xs:integer(request:get-parameter("start", "1")) let $records := xs:integer(request:get-parameter("records", "20")) let $query-base := request:get-url() … for $term at $count in subsequence(collection($collection)/term, $start, $records) return … <input type="button" onClick="parent.location='{$query-base}?start={$start - $records}&records={$records}'" value="Previous"/> <input type="button" onClick="parent.location='{$query-base}?start={$start + $records}&records={$records}'" value="Next"/>

M D Copyright 2008 Dan McCreary & Associates15 View Item let $id := request:get-parameter('id', '') … View Item {let $item := = $id] return ID: Term: {$item/name/text()} { for $def at $count in $item/definition return Definition {$count}: {$def/text()} } } /db/apps/terms/views/view-item.xq?id=123

M D Copyright 2008 Dan McCreary & Associates16 eXist Keyword Extensions All Keywords selects context nodes containing ALL of the keywords in the right-hand argument in any order. The default tokenizer is used to split the right-hand argument into single tokens, i.e. any punctuation or white spaces are used to separate the keywords and, after which, are omitted. Note also that wildcards are allowed, and keyword comparison is NOT case-sensitive. Any Keywords Similar to above, this operator selects context nodes containing ANY of the keywords in the right-hand argument. &= |=

M D Copyright 2008 Dan McCreary & Associates17 Search (: the search query string :) let $q := request:get-parameter('q', "") (: put the search results into memory :) let $search-results := collection($collection)//term[*/text() &= $q] let $count := count($search-results) /db/apps/terms/search/search.xq?q=test Match All Keywords All sub elements of term

M D Copyright 2008 Dan McCreary & Associates18 Search Results List { for $term in $search-results let $id := let $term-name := $term/name/text() order by upper-case($term-name) return {$term-name} }

M D Copyright 2008 Dan McCreary & Associates19 Search.xhtml … Search string: Search

M D Copyright 2008 Dan McCreary & Associates20 Search Results

M D Copyright 2008 Dan McCreary & Associates21 Thank You! Please contact me for more information: Native XML Databases Metadata Management Metadata Registries Service Oriented Architectures Business Intelligence and Data Warehouse Semantic Web Dan McCreary, President Dan McCreary & Associates Metadata Strategy Development (952)