안녕하세요. 처리 및 유효성 검사를하고 있지만 처리 및 유효성 검사의 시작 시간과 종료 시간을 기록하고 싶습니다. 아래 코드는 내가 잘못하고있는 것을 제발 제안 해주세요.작업 시작 시간 및 작업 종료 시간을 BaseX에 기록하는 방법
let $pipelineXml :=
<pipeline id='a111' name='ACH-export' xmlns='http://cms.bloomsbury.com/pipeline'>
<transform href='/transforms/docbook2xml.xsl'/>
<validate href='/validation/taxonomy.sch' failOnError='true'/>
</pipeline>
let $reportChunk := <report>
<info>
<id>{$pipelineXml//@id}</id>
<name>{$pipelineXml//@name}</name>
<submitted-on>{fn:current-dateTime()}</submitted-on>
<user>{user:current()}</user>
</info>
<ingestion-report>
<steps/>
</ingestion-report>
</report>
let $startTime := fn:current-dateTime()
let $validate := validate:rng-report($pipelineXml, bin:decode-string(db:retrieve($config:Database, fn:concat($config:ValidationDir,$config:PipelineRelaxNG)),'UTF-8'), fn:true())
return
if($validate/status='valid')
then
(
admin:write-log("[" || "][Pipeline is valid as per Relax NG : " || $pipelineXml//@id || "]")
,
let $appendReport := let $updateReport := <step>
<type>RELAX NG Validation</type>
<started-on>{$startTime,prof:sleep(20000)}</started-on>
<completed-on>{fn:current-dateTime()}</completed-on>
<status>Pass</status>
<error></error>
</step>
return
copy $target := $reportChunk
modify insert node $updateReport as last into $target/ingestion-report/steps
return $target
return $appendReport
)
else "error"
덕분 형식 시간을 저장하는 2017-09-04T17입니다 14.989 + 05 : 30 <완료-에> 2017-09-04T17 : 17 : 14.989 + 05 : 30 completed-on> 현재까지 코드에서 구현할 수있는 방법은 무엇입니까? –
가이드 용 솔루션 덕분에 Michael : 저는 fn : current-date-time을 replace로 대체했습니다. -dateTime-to-timezone (변환 : integer-to-dateTime (prof : current-ms())) –
위대한 :-) 도움이 되었다면 내 대답을 수락하는 것을 고려해보십시오. https://meta.stackexchange.com/questions/5234/대답하는 법안 – michael