문제

I am writing code for custom grammar for that I created a lexicon file which I am using in XML grammar file. I want to add the lexicon with my software to the end user as an embedded resources so how can i reference it's uri in XML? my XML codes are

<?xml version="1.0" encoding="utf-8"?>
<grammar
  version="1.0" mode="voice" root="Voice_Automator"
  xml:lang="en-IN" tag-format="semantics/1.0"
  sapi:alphabet="x-microsoft-ups"
  xml:base="http://www.contoso.com/"
  xmlns="http://www.w3.org/2001/06/grammar"
  xmlns:sapi="http://schemas.microsoft.com/Speech/2002/06/SRGSExtensions">
  **<lexicon uri="C:\Users\Agrawal\Documents\Visual Studio 2010\Projects\123.pls" />**

i want to use 123.pls file as an embedded resource so at the end user the program should load it properly

올바른 솔루션이 없습니다

다른 팁

Use one of the XML link mechanisms:

  • XLink

    <lexicon xmlns:link="http://www.w3.org/1999/xlink" xlink:href="C:\Users\Agrawal\Documents\Visual Studio 2010\Projects\123.pls"/>
    
  • External Entity

    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE foo [<!ENTITY bar SYSTEM "C:\Users\Agrawal\Documents\Visual Studio 2010\Projects\123.pls"> ]>
    <grammar  version="1.0" mode="voice" root="Voice_Automator"  xml:lang="en-IN" tag-format="semantics/1.0"  sapi:alphabet="x-microsoft-ups"  xml:base="http://www.contoso.com/" xmlns="http://www.w3.org/2001/06/grammar"  xmlns:sapi="http://schemas.microsoft.com/Speech/2002/06/SRGSExtensions">
    <? &bar; ?>
    </grammar>
    

References

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top