Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docx bookmarks get string ids when converting from Html #626

Closed
oyms opened this issue Sep 26, 2012 · 5 comments
Closed

Docx bookmarks get string ids when converting from Html #626

oyms opened this issue Sep 26, 2012 · 5 comments

Comments

@oyms
Copy link

oyms commented Sep 26, 2012

The bookmarkStart gets a string as id, when valid values are of type w:ST_DecimalNumber.
This causes problems downstream when handling the document in other parsers. Word will open the file, though.

<w:bookmarkStart w:id="test-av-nummerering" w:name="test-av-nummerering" />
    <w:p>
      <w:pPr>
        <w:pStyle w:val="Heading1" />
      </w:pPr>
      <w:r>
        <w:t xml:space="preserve">Test av nummerering</w:t>
      </w:r>
    </w:p>
 <w:bookmarkEnd w:id="test-av-nummerering" />
@jgm
Copy link
Owner

jgm commented Sep 26, 2012

Probably a dumb question: Presumably the w:id fields on w:bookmarkStart
have to have unique values. Do they need to be unique with respect to
all of the other w:id fields in the document, or is it enough if no
two w:bookmarkStart elements have the same w:id?

+++ Øyvind Skaar [Sep 26 12 04:45 ]:

The bookmarkStart gets a string as id, when valid values are of type
w:ST_DecimalNumber.
This causes problems downstream when handling the document in other
parsers. Word will open the file, though.

[1]/w:pPr
Test av nummerering[2]/w:t
[3]/w:r
[4]/w:p

--
Reply to this email directly or [5]view it on GitHub.
[J6T91GIPIyhU-8ti4GCGP7AlC2fiocPKodp06RQqyLxwlIvrgBNB7UfQBi-WZGYR.gif]

References

  1. file://localhost/w:pPr
  2. file://localhost/w:t
  3. file://localhost/w:r
  4. file://localhost/w:p
  5. Docx bookmarks get string ids when converting from Html #626

@jgm
Copy link
Owner

jgm commented Sep 26, 2012

Also, does it matter what numbers are used? (e.g. for ordering?) Or could I just assign numbers based on the anchor name?

@oyms
Copy link
Author

oyms commented Sep 27, 2012

This documentation states that the id is to be unique for all annotations in the document. Annotations are element in the "http://schemas.microsoft.com/aml/2001/core" namespace. I do not think the numbers are used in any ordering, but it seems that they are presumed by some framework to be integers.

@jgm
Copy link
Owner

jgm commented Sep 27, 2012

Sounds as if I could simply convert the alphanumeric ID to an integer,
e.g. by concatenating decimal representations of each character. Do you
happen to know if there is a limit on the size of integers they allow?

+++ Øyvind Skaar [Sep 27 12 00:00 ]:

[1]This documentation states that the id is to be unique for all
annotations in the document. Annotations are element in the
"[2]http://schemas.microsoft.com/aml/2001/core" namespace. I do not
think the numbers are used in any ordering, but it seems that it is
presumed by some framework to be integers.

--
Reply to this email directly or [3]view it on GitHub.
[J6T91GIPIyhU-8ti4GCGP7AlC2fiocPKodp06RQqyLxwlIvrgBNB7UfQBi-WZGYR.gif]

References

  1. http://msdn.microsoft.com/en-us/library/documentformat.openxml.wordprocessing.bookmarkstart.aspx
  2. http://schemas.microsoft.com/aml/2001/core
  3. Docx bookmarks get string ids when converting from Html #626 (comment)

@oyms
Copy link
Author

oyms commented Sep 27, 2012

I don't know for sure, but I would guess 32 bit.

@jgm jgm closed this as completed in 02bb0f0 Oct 3, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants