Hi Asit, Norm,

Thanks for your response!

sch:compile-schema() function generates XSLT from Scheamtron as given
below. I need a XSD passing the Schmatron,


declare function sch:compile-schema(
  $schema as node())
as document-node(element(xsl:stylesheet))


I already have XSD to validate all the elements but to validate a
particular element's values, I am going for Schematron (for that element
alone). So, the requirement is

To convert this Schematron (for that element alone) into XSD and then embed
this XSD into original XSD (which is done for all elements)

(OR)

To embed this Schematron (for that element alone) into original XSD (which
is done for all elements) itself.

Please let me know your suggestions.

Warm regards,
Melkis



On Fri, May 29, 2015 at 9:32 PM, <[email protected]>
wrote:

> Send General mailing list submissions to
>         [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://developer.marklogic.com/mailman/listinfo/general
> or, via email, send a message with subject or body 'help' to
>         [email protected]
>
> You can reach the person managing the list at
>         [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of General digest..."
>
>
> Today's Topics:
>
>    1. Re: Embedding Schematron inside XSD and validating a xml
>       document against that XSD (Norman Walsh)
>    2. Re: [MarkLogic Dev General]       XDMP-PATTERNVALUEMISMATCH:
>       xdmp:parse-dateTime (Kari Cowan)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 29 May 2015 13:53:15 +0000
> From: Norman Walsh <[email protected]>
> Subject: Re: [MarkLogic Dev General] Embedding Schematron inside XSD
>         and validating a xml document against that XSD
> To: MarkLogic Developer Discussion <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Asitmohan Nautiyal <[email protected]> writes:
> > If you make direct changes inside the xsd file, it will not work. No
> > need to place your change directly inside the xsd file. Place your
> > changes inside the xml schematron file and then compile it in query
> > console using sch:compile-schema() function of schematron.xqy file. It
> > will generate a compiled xsd file and then use this file against the
> > xml file, which you want to validate.
>
> I expect that sch:compile-schema() could be augmented to extract
> schematron rules from an XSD if that was considered a useful feature.
> (And assuming sch:compile-schema is this from here
> https://github.com/ndw/ML-Schematron)
>
>                                         Be seeing you,
>                                           norm
>
> --
> Norman Walsh
> Lead Engineer
> MarkLogic Corporation
> Phone: +1 512 761 6676
> www.marklogic.com
>
> ------------------------------
>
> Message: 2
> Date: Fri, 29 May 2015 16:03:02 +0000
> From: Kari Cowan <[email protected]>
> Subject: Re: [MarkLogic Dev General]    XDMP-PATTERNVALUEMISMATCH:
>         xdmp:parse-dateTime
> To: MarkLogic Developer Discussion <[email protected]>
> Message-ID:
>         <08b718b8ce98354e94d0201c94f374ad18b02...@exmb01nyc1.nyc.amlaw.corp
> >
> Content-Type: text/plain; charset="us-ascii"
>
> So many good ideas/ways to deal with it.  I ended up rewriting the bit
> posted on Stack Overflow to suit my case.
>
> It's good to know that the next release probably handles this natively.
>
> Thanks all!
>
> From: [email protected] [mailto:
> [email protected]] On Behalf Of Jason Hunter
> Sent: Friday, May 29, 2015 1:22 AM
> To: MarkLogic Developer Discussion
> Subject: Re: [MarkLogic Dev General] XDMP-PATTERNVALUEMISMATCH:
> xdmp:parse-dateTime
>
> Long ago we wrote a date parser for MarkMail which can sniff out and
> handle most dates that actually appear in mail messages.
>
> https://github.com/marklogic/commons/blob/master/dates/date-parser.xqy
>
> -jh-
>
> On May 29, 2015, at 9:14 AM, David Lee <[email protected]<mailto:
> [email protected]>> wrote:
>
>
> Month names, (other names like day of week, but mostly month) have an
> ambiguity problem for parsing in the XPath date format specs, which were
> intended originally for printing not parsing.   A degenerate case is a
> pattern like "[MNn,3][D]" (note no separator and implementation dependent
> widths)
> So formally the problem is intractable.
> Pragmatically the issue stems from the ICU library being used which does
> not provide for a good mapping between W3C format picture
> and ICU patterns - around V7 time the whole datetime formatting and
> parsing code was redone and a side effect of much better formatting
> is the inability to parse names.
>
> I suggest something simple.  It would be in the server code if it could be
> done generically and for all locales but it cant.
> Roughly ...
>
> declare variable $months := ( "Jan" , "Feb" , "Mar" ... );
> let $date := "Jan 10, 2013"
> let $tok := fn:tokenize($date,",? +"),
>     $m := fn:index-of( $months, $tok[1] )  ,
>     $d := xs:integer($tok[2]),
>     $y := $tok[3]
>
>  return ( $y  || "-" || (if( $m lt 9 ) then "0" else "") || $m ||"-" ||
> (if(  $d lt 10) then "0" else "")  || $d  )
>
> ----
> Or something similar fromthe functx library
>
>
>
> -----------------------------------------------------------------------------
> David Lee
> Lead Engineer
> MarkLogic Corporation
> [email protected]<mailto:[email protected]>
> Phone: +1 812-482-5224
> Cell:  +1 812-630-7622
> www.marklogic.com<http://www.marklogic.com/>
>
> From: [email protected]<mailto:
> [email protected]> [mailto:
> [email protected]] On Behalf Of Danny Sokolsky
> Sent: Thursday, May 28, 2015 6:44 PM
> To: MarkLogic Developer Discussion
> Subject: Re: [MarkLogic Dev General] XDMP-PATTERNVALUEMISMATCH:
> xdmp:parse-dateTime
>
> Hi Kari,
>
> I also see the different behavior on 7 and the latest 8.  There is a bug
> fix in my code not yet released, which is likely why it is working for me
> on the latest 8.
>
> The problem is with the Month names.  There is a note in the documentation
> saying this does not always parse the month names.
>
> The only workaround I can think of is to substitute in the month number
> for the month name, as that seems to work on 7.0-5.  But that might get you
> past the problem.
>
> For example, this works on 7.0-5.1:
>
> let $startdateTime := "05 28 2015"
> return
> xdmp:parse-dateTime("[M1] [D1] [Y0001]", $startdateTime, "en")
>
> =>
> 2015-05-28T00:00:00-07:00
>
> -Danny
>
> From: [email protected]<mailto:
> [email protected]> [mailto:
> [email protected]] On Behalf Of Kari Cowan
> Sent: Thursday, May 28, 2015 2:24 PM
> To: MarkLogic Developer Discussion
> Subject: Re: [MarkLogic Dev General] XDMP-PATTERNVALUEMISMATCH:
> xdmp:parse-dateTime
>
> Hmm, I have 8.02 on my local machine, and it still throws that error so it
> must be more recent than that version.  Either way, we're using  v.7 in my
> dev/stage environments (where I am seeing an error), and v.6 on
> production.  It may be a while I have 8 available to me on our live servers.
>
> Any other workaround you might suggest?
>
> From: [email protected]<mailto:
> [email protected]> [mailto:
> [email protected]] On Behalf Of Danny Sokolsky
> Sent: Thursday, May 28, 2015 1:50 PM
> To: MarkLogic Developer Discussion
> Subject: Re: [MarkLogic Dev General] XDMP-PATTERNVALUEMISMATCH:
> xdmp:parse-dateTime
>
> There are a number of bugs that have been fixed on xdmp:parse-dateTime
> since 6.0-3.
>
> This works in a recent 8.0 build:
>
> xquery version "1.0-ml";
>
> let $startdateTime:="May 28, 2015"
> return
> fn:format-dateTime((xdmp:parse-dateTime("[MNn] [D1], [Y0001]",
>                 xs:string( $startdateTime ) )), "[Y0001]-[M01]-[D01]" )
>
>
>
> ?  2015-05-28
>
> -Danny
>
> From: [email protected]<mailto:
> [email protected]> [mailto:
> [email protected]] On Behalf Of Kari Cowan
> Sent: Thursday, May 28, 2015 12:38 PM
> To: [email protected]<mailto:[email protected]
> >
> Subject: [MarkLogic Dev General] XDMP-PATTERNVALUEMISMATCH:
> xdmp:parse-dateTime
>
> Ok, so my date input below is "May 28, 2015", but my script below says my
> pattern doesn't match. I think it should but according to the comment in
> https://docs.marklogic.com/xdmp:parse-dateTime, as of 6.0-3.1 this
> function does not round-trip non-numeric values. For example
> format-dateTime(current-dateTime(), '[MN]') => JUNE but
> xdmp:parse-dateTime('[MN]', 'JUNE') throws XDMP-PATTERNVALUEMISMATCH.
>
> I need to convert a date like "May 28, 2015" to something like 2015-05-28
> so that I can use it to compare dates as a part of a query.  What am I
> missing?  Here's a scriptlet that illustrates the issue.
>
>
>
> xquery version "1.0-ml";
> declare namespace html = "http://www.w3.org/1999/xhtml";;
> declare namespace local="this";
>
> declare function local:convert-date($startdateTime as xs:string) as
> node()*{
>
> fn:format-dateTime((xdmp:parse-dateTime("[MNn] [D1], [Y0001]",
>
> xs:string( $startdateTime ) )),
>
> "[Y0001]-[M01]-[D01]" )
> };
>
> declare variable $startdateTime as xs:string external;
>
> let $startdateTime:="May 28, 2015"
>
> (:
> return $startdateTime
> :)
>
> let $this-start-date:= local:convert-date($startdateTime)
>
>   return $this-start-date
>
>
>
> ________________________________
> Learn more about ALM, visit http://www.alm.com<http://www.alm.com/> . -
> ALM, an Integrated Media Company, is a leading provider of news and
> information for the legal and commercial real estate markets. ALM's
> market-leading brands include The American Lawyer, Corporate Counsel,
> GlobeSt.com<http://GlobeSt.com>, Insight Conferences, Law.com<
> http://Law.com>, Law Journal Press, LegalTech, The National Law Journal
> and Real Estate Forum.
> ________________________________
> Learn more about ALM, visit http://www.alm.com<http://www.alm.com/> . -
> ALM, an Integrated Media Company, is a leading provider of news and
> information for the legal and commercial real estate markets. ALM's
> market-leading brands include The American Lawyer, Corporate Counsel,
> GlobeSt.com<http://GlobeSt.com>, Insight Conferences, Law.com<
> http://Law.com>, Law Journal Press, LegalTech, The National Law Journal
> and Real Estate Forum.
> _______________________________________________
> General mailing list
> [email protected]<mailto:[email protected]>
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://developer.marklogic.com/pipermail/general/attachments/20150529/a31f1e85/attachment.html
>
> ------------------------------
>
> _______________________________________________
> General mailing list
> [email protected]
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
> End of General Digest, Vol 131, Issue 124
> *****************************************
>
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to